clear all

use COMBINED_waves_1234.dta, replace


***Recode states in order***
rename inputstate state
sort state
recode state (4=3) (5=4) (6=5) (8=6) (9=7) (10=8) (11=9) (12=10) (13=11) (15=12) (16=13) (17=14) (18=15) (19=16) (20=17) (21=18) (22=19) (23=20) (24=21) (25=22) (26=23) (27=24) (28=25) (29=26) (30=27) (31=28) (32=29) (33=30) (34=31) (35=32) (36=33) (37=34) (38=35) (39=36) (40=37) (41=38) (42=39) (44=40) (45=41) (46=42) (47=43) (48=44) (49=45) (50=46) (51=47) (53=48) (54=49) (55=50) (56=51)

***Label states**
label define statelabels 1 "Alabama" 2 "Alaska" 3 "Arizona" 4 "Arkansas" 5 "California" 6 "Colorado" 7 "Connecticut" 8 "Delaware" 9 "District of Columbia" 10 "Florida" 11 "Georgia" 12 "Hawaii" 13 "Idaho" 14 "Illinois" 15 "Indiana" 16 "Iowa" 17 "Kansas" 18 "Kentucky" 19 "Louisiana" 20 "Maine" 21 "Maryland" 22 "Massachusetts" 23 "Michigan" 24 "Minnesota" 25 "Mississippi" 26 "Missouri" 27 "Montana" 28 "Nebraska" 29 "Nevada" 30 "New Hampshire" 31 "New Jersey" 32 "New Mexico" 33 "New York" 34 "North Carolina" 35 "North Dakota" 36 "Ohio" 37 "Oklahoma" 38 "Oregon" 39 "Pennsylvania" 40 "Rhode Island" 41 "South Carolina" 42 "South Dakota" 43 "Tennessee" 44 "Texas" 45 "Utah" 46 "Vermont" 47 "Virginia" 48 "Washington" 49 "West Virginia" 50 "Wisconsin" 51 "Wyoming"
label values state statelabels


***Create string utility variable***
gen utility_type=.
replace utility_type=1 if OwnershipType=="Municipal"
replace utility_type=2 if OwnershipType=="Investor Owned"
replace utility_type=3 if OwnershipType=="Cooperative"
label define utilitylabel 1 "Municipal" 2 "IOU" 3 "Coop"
label values utility_type utilitylabel

gen muni = (utility_type==1)
gen iou = (utility_type==2)
gen coop = (utility_type==3)

save COMBINED_waves_1234.dta, replace


****Collapse dataset into variable of interest for each month, rename variables into common names, and append****
******May Data******
use COMBINED_waves_1234.dta, replace
keep weight1 weight4 caseid_National caseid_Indiana caseid_w1 inputzip1 marstat state utility_type muni iou coop electricity1 gas1 wood1 propane1 fueloil1 age hhsize1 hh_under51 any_under51 any_over651 hh_over651 covid_lostwork1 covid_insurance1 covid_lessinsurance1 no_insurance1 any_disability1 home_trailer1 home_apartmentcondo1 home_singlefam1 home_other1 hh_disability1 educ1 educ_HS1 homeowner1 ownhome1 retired race white black hispanic native_american female hhinc1 fpl1 under_100_fpl1 FPL_100_1501 FPL_150_2001 dwelling_type1 poor_insulation1 drafty1 mold1 holes1 plumbing1 exposed_sockets1 nonworking_stove_fridge1 broken_ac1 dwelling_condition1 fuel_payment1 hhbill_year notice_year disconnect_year hhbill_3months1 notice_3months1 disconnect_3months1 hhbill_may notice_may disconnect_may electronic_device1 energybill_change1 covid_stimulus1 energy_assistance_may gov_agency_may energy_provider_may friend_family_may faith_org_may nonprofit_may payday_lender_may bankloan_may gov_assistance_may covid_foregoexpenses wap_may liheap_may snap_may tanf_may ssi_may medicaid_may vet_benefits_may unemp_insurance_may gov_assistance_may stove_may spaceheater_may woodstove_may fireplace_may hotshower_may burntrash_may heavycoat_may boughtice_may coldshower_may covid_employment1 covid_rent1 covid_feedfamily1 covid_medicalcare1 covid_lostinsurance1 date_unemployed1 employed1 unemployed1 employ1 hh1_income1 hh2_income1 hh3_income1 hh4_income1 hh5_income1 hh6_income1 hh7_income1 hh8_income1 income1 covid_employmentchange_open1 employmentstatus_open1 maintaintemp_open1 energyassist_lastyr_open1 govassistance_lastyr_open1 monthly_rent1 monthly_energy1 monthly_groceries


drop if hhbill_may==.


gen month=1
gen wave=1

rename weight1 weight
rename weight4 weight_balanced
rename inputzip1 zip
rename electricity1 electricity
rename gas1 gas
rename wood1 wood
rename propane1 propane
rename fueloil1 fuel
rename hhsize1 hhsize
rename hh_under51 hh_under5
rename hh_over651 hh_over65
rename any_under51 any_under5
rename any_over651 any_over65
rename covid_lostwork1 covid_lostwork
rename covid_insurance1 covid_insurance
rename covid_lessinsurance1 covid_lessinsurance
rename no_insurance1 no_insurance
rename any_disability1 any_disability
rename home_trailer1 home_trailer
rename home_apartmentcondo1 home_apartmentcondo
rename home_singlefam1 home_singlefam
rename home_other1 home_other
rename hh_disability1 hh_disability
rename educ1 educ
rename educ_HS1 educ_HS
rename homeowner1 homeowner
rename ownhome1 ownhome
rename hhinc1 hhinc
rename fpl1 fpl
rename under_100_fpl1 under_100_fpl
rename FPL_100_1501 FPL_100_150
rename FPL_150_2001 FPL_150_200
rename poor_insulation1 poor_insulation
rename dwelling_type1 dwelling_type
rename drafty1 drafty
rename mold1 mold
rename holes1 holes
rename plumbing1 plumbing
rename exposed_sockets1 exposed_sockets
rename nonworking_stove_fridge1 nonworking_stove_fridge
rename broken_ac1 broken_ac
rename dwelling_condition1 dwelling_condition
rename fuel_payment1 fuel_payment
rename hhbill_may hhbill
rename notice_may notice
rename disconnect_may disconnect
rename electronic_device1 electronic_device
rename energybill_change1 energybill_change
rename covid_stimulus1 stimulus
rename energy_assistance_may energy_assistance
rename gov_agency_may gov_agency
rename energy_provider_may energy_provider
rename friend_family_may friend_family
rename faith_org_may faith_org
rename nonprofit_may nonprofit
rename payday_lender_may payday_lender
rename bankloan_may bankloan
rename gov_assistance_may gov_assistance
rename covid_foregoexpenses forego_expenses
rename wap_may wap
rename liheap_may liheap
rename snap_may snap
rename tanf_may tanf
rename ssi_may ssi
rename medicaid_may medicaid
rename vet_benefits_may vet_benefits
rename unemp_insurance_may unemp_insurance
rename stove_may stove
rename spaceheater_may spaceheater
rename woodstove_may woodstove
rename fireplace_may fireplace
rename hotshower_may hotshower
rename burntrash_may burntrash
rename heavycoat_may heavycoat
rename boughtice_may boughtice
rename coldshower_may coldshower
rename covid_employment1 covid_employment
rename covid_rent1 covid_rent
rename covid_feedfamily1 covid_feedfamily
rename covid_medicalcare1 covid_medicalcare
rename covid_lostinsurance1 covid_lostinsurance
rename date_unemployed1 date_unemployed
rename employed1 employed
rename unemployed1 unemployed
rename employ1 employ
rename hh1_income1 hh1_income
rename hh2_income1 hh2_income
rename hh3_income1 hh3_income
rename hh4_income1 hh4_income
rename hh5_income1 hh5_income
rename hh6_income1 hh6_income
rename hh7_income1 hh7_income
rename hh8_income1 hh8_income
rename income1 income


save may_energy_insecurity.dta, replace


******june Data******
use COMBINED_waves_1234.dta, replace
keep weight2 weight4 caseid_National caseid_Indiana caseid_w1 inputzip2 marstat state utility_type muni iou coop electricity2 gas2 wood2 propane2 fueloil2 age hhsize2 hh_under52 any_under52 any_over652 hh_over652 covid_lostwork2 covid_insurance2 covid_lessinsurance2 no_insurance2 any_disability2 home_trailer2 home_apartmentcondo2 home_singlefam2 home_other2 utilitybill_pay_irregular2 utilitydebt_over1002 genhealth_goodtogreat2 hh_disability2 educ2 educ_HS2 homeowner2 ownhome2 retired race white black hispanic native_american female hhinc2 fpl2 under_100_fpl2 FPL_100_1502 FPL_150_2002 dwelling_type1 dwelling_type2 poor_insulation1 drafty1 mold1 holes1 plumbing1 exposed_sockets1 nonworking_stove_fridge1 broken_ac1 poor_insulation2 drafty2 mold2 holes2 plumbing2 exposed_sockets2 nonworking_stove_fridge2 broken_ac2 trust_energyco2 dwelling_condition1 dwelling_condition2 fuel_payment2 hhbill_june notice_june disconnect_june electronic_device2 energybill_change2 stimulus_june energy_assistance_june gov_agency_june energy_provider_june friend_family_june faith_org_june nonprofit_june payday_lender_june bankloan_june gov_assistance_june forego_expenses_june wap_june liheap_june snap_june tanf_june ssi_june medicaid_june vet_benefits_june unemp_insurance_june gov_assistance_june stove_3mos2 spaceheater_3mos2 woodstove_3mos2 fireplace_3mos2 hotshower_3mos2 burntrash_3mos2 heavycoat_3mos2 boughtice_3mos2 coldshowers_3mos2 dryer_3mos2 centralac_3mos2 windowac_3mos2 fan_3mos2 dehumidifier_3mos2 lefthouse_3mos2 openedwindows_3mos2 covid_employment2 covid_rent2 covid_feedfamily2 covid_medicalcare2 covid_lostinsurance2 date_unemployed2 employed2 unemployed2 employ2 efficient_appliances2 efficient_insulation2 efficient_ac2 efficient_smartmeter2 efficient_lights2 efficient_hometemp2 efficient_devices2 efficient_hungwindow2 utilitypay_check2 utilitypay_credit2 utilitypay_debit2 utilitypay_withdrawal2 utilitypay_cash2 utilitybill_pay2 utilityhelp_friend2 utilityhelp_paydayloan2 utilityhelp_credit2 utilityhelp_notice2 utility_debt2 debt_over10002 behind_rent2 behind_credit2 behind_car2 behind_medical2 behind_bankloan2 behind_personalloan2 behind_studentloan2 evictnotice_june evicted_june legal_help2 legal_access2 legal_source2 generalhealth_rate2 prescription2 fill_prescription2 mentalhealth_days2 highbloodpressure2 heartdisease2 diabetes2 cancer2 obesity2 asthma2 hh1_income2 hh2_income2 hh3_income2 hh4_income2 hh5_income2 hh6_income2 hh7_income2 hh8_income2 income2 dwelling_open2 employmentstatus_open2 chronic_conditions_open2 debt_over1000_open2 maintainbills_open2 utilitybillpay_open2 utilitybillhelp_open2 utilitypaymethod_open2 covid_employmentchange_open2 staycool_open2 staywarm_open2 govassist_open2 energyassist_open2 response_notice_open2 energyefficiency_open2 sought_govagency2 sought_bank2 sought_payday2 sought_utility2 sought_nonprofit2 sought_faithbased2 sought_family_friends2 form_call2 form_letter2 form_doorknock2 form_email2 form_text2 received_govagency2 received_bank2 received_payday2 received_utility2 received_nonprofit2 received_faithbased2 received_family_friends2 response_contactutility2 response_paymentplan2 response_legalservices2 response_assistance2 response_internet2 response_homechanges2 response_reduceenergy2 response_moved2 reconnection_cost2 response_moved_temp2 response_moved_perm2 response_livedwithout2 response_otherhelp2 response_paidoff2 response_usedothers2 response_carorbattery2 no_ac2 no_ac_reason2


drop if hhbill_june==.


gen month=2
gen wave=2

rename weight2 weight
rename weight4 weight_balanced
rename inputzip2 zip
rename electricity2 electricity
rename gas2 gas
rename wood2 wood
rename propane2 propane
rename fueloil2 fuel
rename hhsize2 hhsize
rename hh_under52 hh_under5
rename hh_over652 hh_over65
rename any_under52 any_under5
rename any_over652 any_over65
rename covid_lostwork2 covid_lostwork
rename covid_insurance2 covid_insurance
rename covid_lessinsurance2 covid_lessinsurance
rename no_insurance2 no_insurance
rename any_disability2 any_disability
rename home_trailer2 home_trailer
rename home_apartmentcondo2 home_apartmentcondo
rename home_singlefam2 home_singlefam
rename home_other2 home_other
rename utilitybill_pay_irregular2 utilitybill_pay_irregular
rename utilitydebt_over1002 utility_debt_over100
rename genhealth_goodtogreat2 genhealth_goodtogreat
rename hh_disability2 hh_disability
rename educ2 educ
rename educ_HS2 educ_HS
rename homeowner2 homeowner
rename ownhome2 ownhome
rename hhinc2 hhinc
rename fpl2 fpl
rename under_100_fpl2 under_100_fpl
rename FPL_100_1502 FPL_100_150
rename FPL_150_2002 FPL_150_200
rename dwelling_type1 dwelling_type
gen poor_insulation=0
replace poor_insulation=1 if poor_insulation1==1 | poor_insulation2==1
gen drafty=0
replace drafty=1 if drafty1==1 | drafty2==1
gen mold=0
replace mold=1 if mold1==1 | mold2==1
gen holes=0
replace holes=1 if holes1==1 | holes2==1
gen plumbing=0
replace plumbing=1 if plumbing1==1 | plumbing2==1
gen exposed_sockets=0
replace exposed_sockets=1 if exposed_sockets1==1 | exposed_sockets2==1
gen nonworking_stove_fridge=0
replace nonworking_stove_fridge=1 if nonworking_stove_fridge1==1 | nonworking_stove_fridge2==1
gen broken_ac=0
replace broken_ac=1 if broken_ac1==1 | broken_ac2==1
gen dwelling_condition=0
replace dwelling_condition=1 if dwelling_condition1==1 | dwelling_condition2==1
rename trust_energyco2 trust_energyco
rename fuel_payment2 fuel_payment
rename hhbill_june hhbill
rename notice_june notice
rename disconnect_june disconnect
rename electronic_device2 electronic_device
rename energybill_change2 energybill_change
rename stimulus_june stimulus
rename energy_assistance_june energy_assistance
rename gov_agency_june gov_agency
rename energy_provider_june energy_provider
rename friend_family_june friend_family
rename faith_org_june faith_org
rename nonprofit_june nonprofit
rename payday_lender_june payday_lender
rename bankloan_june bankloan
rename gov_assistance_june gov_assistance
rename forego_expenses_june forego_expenses
rename wap_june wap
rename liheap_june liheap
rename snap_june snap
rename tanf_june tanf
rename ssi_june ssi
rename medicaid_june medicaid
rename vet_benefits_june vet_benefits
rename unemp_insurance_june unemp_insurance
rename stove_3mos2 stove
rename spaceheater_3mos2 spaceheater
rename woodstove_3mos2 woodstove
rename fireplace_3mos2 fireplace
rename hotshower_3mos2 hotshower
rename burntrash_3mos2 burntrash
rename heavycoat_3mos2 heavycoat
rename boughtice_3mos2 boughtice
rename coldshowers_3mos2 coldshower
rename dryer_3mos2 dryer
rename centralac_3mos2 centralac
rename windowac_3mos2 windowac
rename fan_3mos2 fan
rename dehumidifier_3mos2 dehumidifier
rename lefthouse_3mos2 lefthouse
rename openedwindows_3mos2 openedwindows
rename covid_employment2 covid_employment
rename covid_rent2 covid_rent
rename covid_feedfamily2 covid_feedfamily
rename covid_medicalcare2 covid_medicalcare
rename covid_lostinsurance2 covid_lostinsurance
rename date_unemployed2 date_unemployed
rename employed2 employed
rename unemployed2 unemployed
rename employ2 employ
rename efficient_appliances2 efficient_appliances
rename efficient_insulation2 efficient_insulation
rename efficient_ac2 efficient_ac
rename efficient_smartmeter2 efficient_smartmeter
rename efficient_lights2 efficient_lights
rename efficient_hometemp2 efficient_hometemp
rename efficient_devices2 efficient_devices
rename efficient_hungwindow2 efficient_hungwindow
rename utilitypay_check2 utilitypay_check
rename utilitypay_credit2 utilitypay_credit
rename utilitypay_debit2 utilitypay_debite
rename utilitypay_withdrawal2 utilitypay_withdrawal
rename utilitypay_cash2 utilitypay_cash
rename utilitybill_pay2 utilitybill_pay
rename utilityhelp_friend2 utilityhelp_friend
rename utilityhelp_paydayloan2 utilityhelp_paydayloan
rename utilityhelp_credit2 utilityhelp_credit
rename utilityhelp_notice2 utilityhelp_notice
rename utility_debt2 utility_debt
rename debt_over10002 debt_over1000
rename behind_rent2 behind_rent
rename behind_credit2 behind_credit
rename behind_car2 behind_car
rename behind_medical2 behind_medical
rename behind_bankloan2 behind_bankloan
rename behind_personalloan2 behind_personalloan
rename behind_studentloan2 behind_studentloan
rename evictnotice_june evict_notice
rename evicted_june evicted
rename legal_help2 legal_help
rename legal_access2 legal_access
rename legal_source2 legal_source
rename generalhealth_rate2 generalhealth_rate
rename prescription2 prescription
rename fill_prescription2 fill_prescription
rename mentalhealth_days2 mentalhealth_days
rename highbloodpressure2 highbloodpressure
rename heartdisease2 heartdisease
rename diabetes2 diabetes
rename cancer2 cancer
rename obesity2 obesity
rename asthma2 asthma
rename hh1_income2 hh1_income
rename hh2_income2 hh2_income
rename hh3_income2 hh3_income
rename hh4_income2 hh4_income
rename hh5_income2 hh5_income
rename hh6_income2 hh6_income
rename hh7_income2 hh7_income
rename hh8_income2 hh8_income
rename income2 income
rename sought_govagency2 sought_govagency
rename sought_bank2 sought_bank
rename sought_payday2 sought_payday
rename sought_utility2 sought_utility
rename sought_nonprofit2 sought_nonprofit
rename sought_faithbased2 sought_faithbased
rename sought_family_friends2 sought_family_friends
rename form_call2 form_call
rename form_letter2 form_letter 
rename form_doorknock2 form_doorknock 
rename form_email2 form_email 
rename form_text2 form_text
rename received_govagency2 received_govagency
rename received_bank2 received_bank
rename received_payday2 received_payday
rename received_utility2 received_utility
rename received_nonprofit2 received_nonprofit
rename received_faithbased2 received_faithbased
rename received_family_friends2 received_family_friends
rename response_contactutility2 response_contactutility
rename response_paymentplan2 response_paymentplan
rename response_legalservices2 response_legalservices
rename response_assistance2 response_assistance
rename response_internet2 response_internet
rename response_homechanges2 response_homechanges
rename response_reduceenergy2 response_reduceenergy
rename response_moved2 response_moved
rename reconnection_cost2 reconnection_cost
rename response_moved_temp2 response_moved_temp
rename response_moved_perm2 response_moved_perm
rename response_livedwithout2 response_livedwithout
rename response_otherhelp2 response_otherhelp
rename response_paidoff2 response_paidoff
rename response_usedothers2 response_usedothers
rename response_carorbattery2 response_carorbattery
rename no_ac2 no_ac
rename no_ac_reason2 no_ac_reason




save june_energy_insecurity.dta, replace

clear


******july Data******
use COMBINED_waves_1234.dta, replace
keep weight2 weight4 caseid_National caseid_Indiana caseid_w1 inputzip2 marstat state utility_type muni iou coop electricity2 gas2 wood2 propane2 fueloil2 age hhsize2 hh_under52 any_under52 any_over652 hh_over652 covid_lostwork2 covid_insurance2 covid_lessinsurance2 no_insurance2 any_disability2 home_trailer2 home_apartmentcondo2 home_singlefam2 home_other2 utilitybill_pay_irregular2 utilitydebt_over1002 genhealth_goodtogreat2 hh_disability2 educ2 educ_HS2 homeowner2 ownhome2 retired race white black hispanic native_american female hhinc2 fpl2 under_100_fpl2 FPL_100_1502 FPL_150_2002 dwelling_type1 dwelling_type2 poor_insulation1 drafty1 mold1 holes1 plumbing1 exposed_sockets1 nonworking_stove_fridge1 broken_ac1 poor_insulation2 drafty2 mold2 holes2 plumbing2 exposed_sockets2 nonworking_stove_fridge2 broken_ac2 trust_energyco2 dwelling_condition1 dwelling_condition2 fuel_payment2 hhbill_july notice_july disconnect_july electronic_device2 energybill_change2 stimulus_july energy_assistance_july gov_agency_july energy_provider_july friend_family_july faith_org_july nonprofit_july payday_lender_july bankloan_july gov_assistance_july forego_expenses_july wap_july liheap_july snap_july tanf_july ssi_july medicaid_july vet_benefits_july unemp_insurance_july gov_assistance_july stove_3mos2 spaceheater_3mos2 woodstove_3mos2 fireplace_3mos2 hotshower_3mos2 burntrash_3mos2 heavycoat_3mos2 boughtice_3mos2 coldshowers_3mos  dryer_3mos2 centralac_3mos2 windowac_3mos2 fan_3mos2 dehumidifier_3mos2 lefthouse_3mos2 openedwindows_3mos2 covid_employment2 covid_rent2 covid_feedfamily2 covid_medicalcare2 covid_lostinsurance2 date_unemployed2 employed2 unemployed2 employ2 efficient_appliances2 efficient_insulation2 efficient_ac2 efficient_smartmeter2 efficient_lights2 efficient_hometemp2 efficient_devices2 efficient_hungwindow2 utilitypay_check2 utilitypay_credit2 utilitypay_debit2 utilitypay_withdrawal2 utilitypay_cash2 utilitybill_pay2 utilityhelp_friend2 utilityhelp_paydayloan2 utilityhelp_credit2 utilityhelp_notice2 utility_debt2 debt_over10002 behind_rent2 behind_credit2 behind_car2 behind_medical2 behind_bankloan2 behind_personalloan2 behind_studentloan2 evictnotice_july evicted_july legal_help2 legal_access2 legal_source2 generalhealth_rate2 prescription2 fill_prescription2 mentalhealth_days2 highbloodpressure2 heartdisease2 diabetes2 cancer2 obesity2 asthma2 hh1_income2 hh2_income2 hh3_income2 hh4_income2 hh5_income2 hh6_income2 hh7_income2 hh8_income2 income2 dwelling_open2 employmentstatus_open2 chronic_conditions_open2 debt_over1000_open2 maintainbills_open2 utilitybillpay_open2 utilitybillhelp_open2 utilitypaymethod_open2 covid_employmentchange_open2 staycool_open2 staywarm_open2 govassist_open2 energyassist_open2 response_notice_open2 energyefficiency_open2 sought_govagency2 sought_bank2 sought_payday2 sought_utility2 sought_nonprofit2 sought_faithbased2 sought_family_friends2 form_call2 form_letter2 form_doorknock2 form_email2 form_text2 received_govagency2 received_bank2 received_payday2 received_utility2 received_nonprofit2 received_faithbased2 received_family_friends2 response_contactutility2 response_paymentplan2 response_legalservices2 response_assistance2 response_internet2 response_homechanges2 response_reduceenergy2 response_moved2 reconnection_cost2 response_moved_temp2 response_moved_perm2 response_livedwithout2 response_otherhelp2 response_paidoff2 response_usedothers2 response_carorbattery2 no_ac2 no_ac_reason2


drop if hhbill_july==.

gen month=3
gen wave=2

rename weight2 weight
rename weight4 weight_balanced
rename inputzip2 zip
rename electricity2 electricity
rename gas2 gas
rename wood2 wood
rename propane2 propane
rename fueloil2 fueloil
rename hhsize2 hhsize
rename hh_under52 hh_under5
rename hh_over652 hh_over65
rename any_under52 any_under5
rename any_over652 any_over65
rename covid_lostwork2 covid_lostwork
rename covid_insurance2 covid_insurance
rename covid_lessinsurance2 covid_lessinsurance
rename no_insurance2 no_insurance
rename any_disability2 any_disability
rename home_trailer2 home_trailer
rename home_apartmentcondo2 home_apartmentcondo
rename home_singlefam2 home_singlefam
rename home_other2 home_other
rename utilitybill_pay_irregular2 utilitybill_pay_irregular
rename utilitydebt_over1002 utility_debt_over100
rename genhealth_goodtogreat2 genhealth_goodtogreat
rename hh_disability2 hh_disability
rename educ2 educ
rename educ_HS2 educ_HS
rename homeowner2 homeowner
rename ownhome2 ownhome
rename hhinc2 hhinc
rename fpl2 fpl
rename under_100_fpl2 under_100_fpl
rename FPL_100_1502 FPL_100_150
rename FPL_150_2002 FPL_150_200
rename dwelling_type1 dwelling_type
gen poor_insulation=0
replace poor_insulation=1 if poor_insulation1==1 | poor_insulation2==1
gen drafty=0
replace drafty=1 if drafty1==1 | drafty2==1
gen mold=0
replace mold=1 if mold1==1 | mold2==1
gen holes=0
replace holes=1 if holes1==1 | holes2==1
gen plumbing=0
replace plumbing=1 if plumbing1==1 | plumbing2==1
gen exposed_sockets=0
replace exposed_sockets=1 if exposed_sockets1==1 | exposed_sockets2==1
gen nonworking_stove_fridge=0
replace nonworking_stove_fridge=1 if nonworking_stove_fridge1==1 | nonworking_stove_fridge2==1
gen broken_ac=0
replace broken_ac=1 if broken_ac1==1 | broken_ac2==1
gen dwelling_condition=0
replace dwelling_condition=1 if dwelling_condition1==1 | dwelling_condition2==1
rename trust_energyco2 trust_energyco
rename fuel_payment2 fuel_payment
rename hhbill_july hhbill
rename notice_july notice
rename disconnect_july disconnect
rename electronic_device2 electronic_device
rename energybill_change2 energybill_change
rename stimulus_july stimulus
rename energy_assistance_july energy_assistance
rename gov_agency_july gov_agency
rename energy_provider_july energy_provider
rename friend_family_july friend_family
rename faith_org_july faith_org
rename nonprofit_july nonprofit
rename payday_lender_july payday_lender
rename bankloan_july bankloan
rename gov_assistance_july gov_assistance
rename forego_expenses_july forego_expenses
rename wap_july wap
rename liheap_july liheap
rename snap_july snap
rename tanf_july tanf
rename ssi_july ssi
rename medicaid_july medicaid
rename vet_benefits_july vet_benefits
rename unemp_insurance_july unemp_insurance
rename stove_3mos2 stove
rename spaceheater_3mos2 spaceheater
rename woodstove_3mos2 woodstove
rename fireplace_3mos2 fireplace
rename hotshower_3mos2 hotshower
rename burntrash_3mos2 burntrash
rename heavycoat_3mos2 heavycoat
rename boughtice_3mos2 boughtice
rename coldshowers_3mos2 coldshower
rename dryer_3mos2 dryer
rename centralac_3mos2 centralac
rename windowac_3mos2 windowac
rename fan_3mos2 fan
rename dehumidifier_3mos2 dehumidifier
rename lefthouse_3mos2 lefthouse
rename openedwindows_3mos2 openedwindows
rename covid_employment2 covid_employment
rename covid_rent2 covid_rent
rename covid_feedfamily2 covid_feedfamily
rename covid_medicalcare2 covid_medicalcare
rename covid_lostinsurance2 covid_lostinsurance
rename date_unemployed2 date_unemployed
rename employed2 employed
rename unemployed2 unemployed
rename employ2 employ
rename efficient_appliances2 efficient_appliances
rename efficient_insulation2 efficient_insulation
rename efficient_ac2 efficient_ac
rename efficient_smartmeter2 efficient_smartmeter
rename efficient_lights2 efficient_lights
rename efficient_hometemp2 efficient_hometemp
rename efficient_devices2 efficient_devices
rename efficient_hungwindow2 efficient_hungwindow
rename utilitypay_check2 utilitypay_check
rename utilitypay_credit2 utilitypay_credit
rename utilitypay_debit2 utilitypay_debite
rename utilitypay_withdrawal2 utilitypay_withdrawal
rename utilitypay_cash2 utilitypay_cash
rename utilitybill_pay2 utilitybill_pay
rename utilityhelp_friend2 utilityhelp_friend
rename utilityhelp_paydayloan2 utilityhelp_paydayloan
rename utilityhelp_credit2 utilityhelp_credit
rename utilityhelp_notice2 utilityhelp_notice
rename utility_debt2 utility_debt
rename debt_over10002 debt_over1000
rename behind_rent2 behind_rent
rename behind_credit2 behind_credit
rename behind_car2 behind_car
rename behind_medical2 behind_medical
rename behind_bankloan2 behind_bankloan
rename behind_personalloan2 behind_personalloan
rename behind_studentloan2 behind_studentloan
rename evictnotice_july evict_notice
rename evicted_july evicted
rename legal_help2 legal_help
rename legal_access2 legal_access
rename legal_source2 legal_source
rename generalhealth_rate2 generalhealth_rate
rename prescription2 prescription
rename fill_prescription2 fill_prescription
rename mentalhealth_days2 mentalhealth_days
rename highbloodpressure2 highbloodpressure
rename heartdisease2 heartdisease
rename diabetes2 diabetes
rename cancer2 cancer
rename obesity2 obesity
rename asthma2 asthma
rename hh1_income2 hh1_income
rename hh2_income2 hh2_income
rename hh3_income2 hh3_income
rename hh4_income2 hh4_income
rename hh5_income2 hh5_income
rename hh6_income2 hh6_income
rename hh7_income2 hh7_income
rename hh8_income2 hh8_income
rename income2 income
rename sought_govagency2 sought_govagency
rename sought_bank2 sought_bank
rename sought_payday2 sought_payday
rename sought_utility2 sought_utility
rename sought_nonprofit2 sought_nonprofit
rename sought_faithbased2 sought_faithbased
rename sought_family_friends2 sought_family_friends
rename form_call2 form_call
rename form_letter2 form_letter 
rename form_doorknock2 form_doorknock 
rename form_email2 form_email 
rename form_text2 form_text
rename received_govagency2 received_govagency
rename received_bank2 received_bank
rename received_payday2 received_payday
rename received_utility2 received_utility
rename received_nonprofit2 received_nonprofit
rename received_faithbased2 received_faithbased
rename received_family_friends2 received_family_friends
rename response_contactutility2 response_contactutility
rename response_paymentplan2 response_paymentplan
rename response_legalservices2 response_legalservices
rename response_assistance2 response_assistance
rename response_internet2 response_internet
rename response_homechanges2 response_homechanges
rename response_reduceenergy2 response_reduceenergy
rename response_moved2 response_moved
rename reconnection_cost2 reconnection_cost
rename response_moved_temp2 response_moved_temp
rename response_moved_perm2 response_moved_perm
rename response_livedwithout2 response_livedwithout
rename response_otherhelp2 response_otherhelp
rename response_paidoff2 response_paidoff
rename response_usedothers2 response_usedothers
rename response_carorbattery2 response_carorbattery
rename no_ac2 no_ac
rename no_ac_reason2 no_ac_reason




save july_energy_insecurity.dta, replace

clear



******august Data******
use COMBINED_waves_1234.dta, replace
keep weight2 weight4 caseid_National caseid_Indiana caseid_w1 inputzip2 marstat state utility_type muni iou coop electricity2 gas2 wood2 propane2 fueloil2 age hhsize2 hh_under52 any_under52 any_over652 hh_over652 covid_lostwork2 covid_insurance2 covid_lessinsurance2 no_insurance2 any_disability2 home_trailer2 home_apartmentcondo2 home_singlefam2 home_other2 utilitybill_pay_irregular2 utilitydebt_over1002 genhealth_goodtogreat2 hh_disability2 educ2 educ_HS2 homeowner2 ownhome2 retired race white black hispanic native_american female hhinc2 fpl2 under_100_fpl2 FPL_100_1502 FPL_150_2002 dwelling_type1 dwelling_type2 poor_insulation1 drafty1 mold1 holes1 plumbing1 exposed_sockets1 nonworking_stove_fridge1 broken_ac1 poor_insulation2 drafty2 mold2 holes2 plumbing2 exposed_sockets2 nonworking_stove_fridge2 broken_ac2 trust_energyco2 dwelling_condition1 dwelling_condition2 fuel_payment2 hhbill_august notice_august disconnect_august electronic_device2 energybill_change2 stimulus_august energy_assistance_august gov_agency_august energy_provider_august friend_family_august faith_org_august nonprofit_august payday_lender_august bankloan_august gov_assistance_august forego_expenses_august wap_august liheap_august snap_august tanf_august ssi_august medicaid_august vet_benefits_august unemp_insurance_august gov_assistance_august stove_3mos2 spaceheater_3mos2 woodstove_3mos2 fireplace_3mos2 hotshower_3mos2 burntrash_3mos2 heavycoat_3mos2 boughtice_3mos2 coldshowers_3mos2 dryer_3mos2 centralac_3mos2 windowac_3mos2 fan_3mos2 dehumidifier_3mos2 lefthouse_3mos2 openedwindows_3mos2 covid_employment2 covid_rent2 covid_feedfamily2 covid_medicalcare2 covid_lostinsurance2 date_unemployed2 employed2 unemployed2 employ2 efficient_appliances2 efficient_insulation2 efficient_ac2 efficient_smartmeter2 efficient_lights2 efficient_hometemp2 efficient_devices2 efficient_hungwindow2 utilitypay_check2 utilitypay_credit2 utilitypay_debit2 utilitypay_withdrawal2 utilitypay_cash2 utilitybill_pay2 utilityhelp_friend2 utilityhelp_paydayloan2 utilityhelp_credit2 utilityhelp_notice2 utility_debt2 debt_over10002 behind_rent2 behind_credit2 behind_car2 behind_medical2 behind_bankloan2 behind_personalloan2 behind_studentloan2 evictnotice_august evicted_august legal_help2 legal_access2 legal_source2 generalhealth_rate2 prescription2 fill_prescription2 mentalhealth_days2 highbloodpressure2 heartdisease2 diabetes2 cancer2 obesity2 asthma2 hh1_income2 hh2_income2 hh3_income2 hh4_income2 hh5_income2 hh6_income2 hh7_income2 hh8_income2 income2 dwelling_open2 employmentstatus_open2 chronic_conditions_open2 debt_over1000_open2 maintainbills_open2 utilitybillpay_open2 utilitybillhelp_open2 utilitypaymethod_open2 covid_employmentchange_open2 staycool_open2 staywarm_open2 govassist_open2 energyassist_open2 response_notice_open2 energyefficiency_open2 sought_govagency2 sought_bank2 sought_payday2 sought_utility2 sought_nonprofit2 sought_faithbased2 sought_family_friends2 form_call2 form_letter2 form_doorknock2 form_email2 form_text2 received_govagency2 received_bank2 received_payday2 received_utility2 received_nonprofit2 received_faithbased2 received_family_friends2 response_contactutility2 response_paymentplan2 response_legalservices2 response_assistance2 response_internet2 response_homechanges2 response_reduceenergy2 response_moved2 reconnection_cost2 response_moved_temp2 response_moved_perm2 response_livedwithout2 response_otherhelp2 response_paidoff2 response_usedothers2 response_carorbattery2 no_ac2 no_ac_reason2


drop if hhbill_august==.


gen month=4
gen wave=2

rename weight2 weight
rename weight4 weight_balanced
rename inputzip2 zip
rename electricity2 electricity
rename gas2 gas
rename wood2 wood
rename propane2 propane
rename fueloil2 fueloil
rename hhsize2 hhsize
rename hh_under52 hh_under5
rename hh_over652 hh_over65
rename any_under52 any_under5
rename any_over652 any_over65
rename covid_lostwork2 covid_lostwork
rename covid_insurance2 covid_insurance
rename covid_lessinsurance2 covid_lessinsurance
rename no_insurance2 no_insurance
rename any_disability2 any_disability
rename home_trailer2 home_trailer
rename home_apartmentcondo2 home_apartmentcondo
rename home_singlefam2 home_singlefam
rename home_other2 home_other
rename utilitybill_pay_irregular2 utilitybill_pay_irregular
rename utilitydebt_over1002 utility_debt_over100
rename genhealth_goodtogreat2 genhealth_goodtogreat
rename hh_disability2 hh_disability
rename educ2 educ
rename educ_HS2 educ_HS
rename homeowner2 homeowner
rename ownhome2 ownhome
rename hhinc2 hhinc
rename fpl2 fpl
rename under_100_fpl2 under_100_fpl
rename FPL_100_1502 FPL_100_150
rename FPL_150_2002 FPL_150_200
rename dwelling_type1 dwelling_type
gen poor_insulation=0
replace poor_insulation=1 if poor_insulation1==1 | poor_insulation2==1
gen drafty=0
replace drafty=1 if drafty1==1 | drafty2==1
gen mold=0
replace mold=1 if mold1==1 | mold2==1
gen holes=0
replace holes=1 if holes1==1 | holes2==1
gen plumbing=0
replace plumbing=1 if plumbing1==1 | plumbing2==1
gen exposed_sockets=0
replace exposed_sockets=1 if exposed_sockets1==1 | exposed_sockets2==1
gen nonworking_stove_fridge=0
replace nonworking_stove_fridge=1 if nonworking_stove_fridge1==1 | nonworking_stove_fridge2==1
gen broken_ac=0
replace broken_ac=1 if broken_ac1==1 | broken_ac2==1
gen dwelling_condition=0
replace dwelling_condition=1 if dwelling_condition1==1 | dwelling_condition2==1
rename trust_energyco2 trust_energyco
rename fuel_payment2 fuel_payment
rename hhbill_august hhbill
rename notice_august notice
rename disconnect_august disconnect
rename electronic_device2 electronic_device
rename energybill_change2 energybill_change
rename stimulus_august stimulus
rename energy_assistance_august energy_assistance
rename gov_agency_august gov_agency
rename energy_provider_august energy_provider
rename friend_family_august friend_family
rename faith_org_august faith_org
rename nonprofit_august nonprofit
rename payday_lender_august payday_lender
rename bankloan_august bankloan
rename gov_assistance_august gov_assistance
rename forego_expenses_august forego_expenses
rename wap_august wap
rename liheap_august liheap
rename snap_august snap
rename tanf_august tanf
rename ssi_august ssi
rename medicaid_august medicaid
rename vet_benefits_august vet_benefits
rename unemp_insurance_august unemp_insurance
rename stove_3mos2 stove
rename spaceheater_3mos2 spaceheater
rename woodstove_3mos2 woodstove
rename fireplace_3mos2 fireplace
rename hotshower_3mos2 hotshower
rename burntrash_3mos2 burntrash
rename heavycoat_3mos2 heavycoat
rename boughtice_3mos2 boughtice
rename coldshowers_3mos2 coldshower
rename dryer_3mos2 dryer
rename centralac_3mos2 centralac
rename windowac_3mos2 windowac
rename fan_3mos2 fan
rename dehumidifier_3mos2 dehumidifier
rename lefthouse_3mos2 lefthouse
rename openedwindows_3mos2 openedwindows
rename covid_employment2 covid_employment
rename covid_rent2 covid_rent
rename covid_feedfamily2 covid_feedfamily
rename covid_medicalcare2 covid_medicalcare
rename covid_lostinsurance2 covid_lostinsurance
rename date_unemployed2 date_unemployed
rename employed2 employed
rename unemployed2 unemployed
rename employ2 employ
rename efficient_appliances2 efficient_appliances
rename efficient_insulation2 efficient_insulation
rename efficient_ac2 efficient_ac
rename efficient_smartmeter2 efficient_smartmeter
rename efficient_lights2 efficient_lights
rename efficient_hometemp2 efficient_hometemp
rename efficient_devices2 efficient_devices
rename efficient_hungwindow2 efficient_hungwindow
rename utilitypay_check2 utilitypay_check
rename utilitypay_credit2 utilitypay_credit
rename utilitypay_debit2 utilitypay_debite
rename utilitypay_withdrawal2 utilitypay_withdrawal
rename utilitypay_cash2 utilitypay_cash
rename utilitybill_pay2 utilitybill_pay
rename utilityhelp_friend2 utilityhelp_friend
rename utilityhelp_paydayloan2 utilityhelp_paydayloan
rename utilityhelp_credit2 utilityhelp_credit
rename utilityhelp_notice2 utilityhelp_notice
rename utility_debt2 utility_debt
rename debt_over10002 debt_over1000
rename behind_rent2 behind_rent
rename behind_credit2 behind_credit
rename behind_car2 behind_car
rename behind_medical2 behind_medical
rename behind_bankloan2 behind_bankloan
rename behind_personalloan2 behind_personalloan
rename behind_studentloan2 behind_studentloan
rename evictnotice_august evict_notice
rename evicted_august evicted
rename legal_help2 legal_help
rename legal_access2 legal_access
rename legal_source2 legal_source
rename generalhealth_rate2 generalhealth_rate
rename prescription2 prescription
rename fill_prescription2 fill_prescription
rename mentalhealth_days2 mentalhealth_days
rename highbloodpressure2 highbloodpressure
rename heartdisease2 heartdisease
rename diabetes2 diabetes
rename cancer2 cancer
rename obesity2 obesity
rename asthma2 asthma
rename hh1_income2 hh1_income
rename hh2_income2 hh2_income
rename hh3_income2 hh3_income
rename hh4_income2 hh4_income
rename hh5_income2 hh5_income
rename hh6_income2 hh6_income
rename hh7_income2 hh7_income
rename hh8_income2 hh8_income
rename income2 income
rename sought_govagency2 sought_govagency
rename sought_bank2 sought_bank
rename sought_payday2 sought_payday
rename sought_utility2 sought_utility
rename sought_nonprofit2 sought_nonprofit
rename sought_faithbased2 sought_faithbased
rename sought_family_friends2 sought_family_friends
rename form_call2 form_call
rename form_letter2 form_letter 
rename form_doorknock2 form_doorknock 
rename form_email2 form_email 
rename form_text2 form_text
rename received_govagency2 received_govagency
rename received_bank2 received_bank
rename received_payday2 received_payday
rename received_utility2 received_utility
rename received_nonprofit2 received_nonprofit
rename received_faithbased2 received_faithbased
rename received_family_friends2 received_family_friends
rename response_contactutility2 response_contactutility
rename response_paymentplan2 response_paymentplan
rename response_legalservices2 response_legalservices
rename response_assistance2 response_assistance
rename response_internet2 response_internet
rename response_homechanges2 response_homechanges
rename response_reduceenergy2 response_reduceenergy
rename response_moved2 response_moved
rename reconnection_cost2 reconnection_cost
rename response_moved_temp2 response_moved_temp
rename response_moved_perm2 response_moved_perm
rename response_livedwithout2 response_livedwithout
rename response_otherhelp2 response_otherhelp
rename response_paidoff2 response_paidoff
rename response_usedothers2 response_usedothers
rename response_carorbattery2 response_carorbattery
rename no_ac2 no_ac
rename no_ac_reason2 no_ac_reason



save august_energy_insecurity.dta, replace


clear



******september Data******
use COMBINED_waves_1234.dta, replace
keep weight3 weight4 caseid_National caseid_Indiana caseid_w1 inputzip3 marstat state utility_type muni iou coop electricity3 gas3 wood3 propane3 fueloil3 age hhsize3 hh_under53 any_under53 any_over653 hh_over653 covid_lostwork3 covid_insurance3 covid_lessinsurance3 no_insurance3 any_disability3 home_trailer3 home_apartmentcondo3 home_singlefam3 home_other3 utilitybill_pay_irregular3 utilitydebt_over1003 genhealth_goodtogreat3 hh_disability3 educ3 educ_HS3 homeowner3 ownhome3 retired race white black hispanic native_american female hhinc3 fpl3 under_100_fpl3 FPL_100_1503 FPL_150_2003 dwelling_type1 dwelling_type2 dwelling_type3 poor_insulation1 drafty1 mold1 holes1 plumbing1 exposed_sockets1 nonworking_stove_fridge1 broken_ac1 poor_insulation2 drafty2 mold2 holes2 plumbing2 exposed_sockets2 nonworking_stove_fridge2 broken_ac2 poor_insulation3 drafty3 mold3 holes3 plumbing3 exposed_sockets3 nonworking_stove_fridge3 broken_ac3 trust_energyco3 dwelling_condition1 dwelling_condition2 dwelling_condition3 fuel_payment3 hhbill_september notice_september disconnect_september electronic_device3 energybill_change3 stimulus_september energy_assistance_september gov_agency_september energy_provider_september friend_family_september faith_org_september nonprofit_september payday_lender_september bankloan_september gov_assistance_september forego_expenses_september wap_september liheap_september snap_september tanf_september ssi_september medicaid_september vet_benefits_september unemp_insurance_september gov_assistance_september stove_5mos spaceheater_5mos woodstove_5mos fireplace_5mos hotshower_5mos burntrash_5mos heavycoat_5mos boughtice_5mos coldshowers_5mos dryer_5mos centralac_5mos windowac_5mos fan_5mos dehumidifier_5mos lefthouse_5mos openedwindows_5mos covid_employment3 covid_rent3 covid_feedfamily3 covid_medicalcare3 covid_lostinsurance3 date_unemployed3 employed3 unemployed3 employ3 efficient_appliances3 efficient_insulation3 efficient_ac3 efficient_smartmeter3 efficient_lights3 efficient_hometemp3 efficient_devices3 efficient_hungwindow3 utilitypay_check3 utilitypay_credit3 utilitypay_debit3 utilitypay_withdrawal3 utilitypay_cash3 utilitybill_pay3 utilityhelp_friend3 utilityhelp_paydayloan3 utilityhelp_credit3 utilityhelp_notice3 utility_debt3 debt_over10003 behind_rent3 behind_credit3 behind_car3 behind_medical3 behind_bankloan3 behind_personalloan3 behind_studentloan3 evictnotice_september evicted_september legal_help3 legal_access3 legal_source3 generalhealth_rate3 prescription3 fill_prescription3 mentalhealth_days3 highbloodpressure3 heartdisease3 diabetes3 cancer3 obesity3 asthma3 skipped_meals3 skipped_meals_frequency3 water_bill3 water_shutoff3 hh1_income3 hh2_income3 hh3_income3 hh4_income3 hh5_income3 hh6_income3 hh7_income3 hh8_income3 income3 dwelling_open3 maintainbills_open3 debt_over1000_open3 chronic_conditions_open3 covid_employmentchange_open3 utilitybillpay_open3 utilitybillhelp_open3 utilitypaymethod_open3 staycool_open3 staywarm_open3 govassist_open3 energyassist_open3 response_notice_open3 energyefficiency_open3 sought_govagency3 sought_bank3 sought_payday3 sought_utility3 sought_nonprofit3 sought_faithbased3 sought_family_friends3 form_call3 form_letter3 form_doorknock3 form_email3 form_text3  response_contactutility3 response_paymentplan3 response_legalservices3 response_assistance3 response_internet3 response_homechanges3 response_reduceenergy3 response_moved3 reconnection_cost3 response_moved_temp3 response_moved_perm3 response_livedwithout3 response_otherhelp3 response_paidoff3 response_usedothers3 response_carorbattery3 no_ac3 no_ac_reason3


drop if hhbill_september==.

gen month=5
gen wave=3

rename weight3 weight
rename weight4 weight_balanced
rename inputzip3 zip
rename electricity3 electricity
rename gas3 gas
rename wood3 wood
rename propane3 propane
rename fueloil3 fueloil
rename hhsize3 hhsize
rename hh_under53 hh_under5
rename hh_over653 hh_over65
rename any_under53 any_under5
rename any_over653 any_over65
rename covid_lostwork3 covid_lostwork
rename covid_insurance3 covid_insurance
rename covid_lessinsurance3 covid_lessinsurance
rename no_insurance3 no_insurance
rename any_disability3 any_disability
rename home_trailer3 home_trailer
rename home_apartmentcondo3 home_apartmentcondo
rename home_singlefam3 home_singlefam
rename home_other3 home_other
rename utilitybill_pay_irregular3 utilitybill_pay_irregular
rename utilitydebt_over1003 utility_debt_over100
rename genhealth_goodtogreat3 genhealth_goodtogreat
rename hh_disability3 hh_disability
rename educ3 educ
rename educ_HS3 educ_HS
rename homeowner3 homeowner
rename ownhome3 ownhome
rename hhinc3 hhinc
rename fpl3 fpl
rename under_100_fpl3 under_100_fpl
rename FPL_100_1503 FPL_100_150
rename FPL_150_2003 FPL_150_200
rename dwelling_type1 dwelling_type
gen poor_insulation=0
replace poor_insulation=1 if poor_insulation1==1 | poor_insulation2==1 | poor_insulation3==1
gen drafty=0
replace drafty=1 if drafty1==1 | drafty2==1 | drafty3==1
gen mold=0
replace mold=1 if mold1==1 | mold2==1 | mold3==1
gen holes=0
replace holes=1 if holes1==1 | holes2==1 | holes3==1
gen plumbing=0
replace plumbing=1 if plumbing1==1 | plumbing2==1 | plumbing3==1
gen exposed_sockets=0
replace exposed_sockets=1 if exposed_sockets1==1 | exposed_sockets2==1 | exposed_sockets3==1
gen nonworking_stove_fridge=0
replace nonworking_stove_fridge=1 if nonworking_stove_fridge1==1 | nonworking_stove_fridge2==1 | nonworking_stove_fridge3==1
gen broken_ac=0
replace broken_ac=1 if broken_ac1==1 | broken_ac2==1 | broken_ac3==1
rename trust_energyco3 trust_energyco
gen dwelling_condition=0
replace dwelling_condition=1 if dwelling_condition1==1 | dwelling_condition2==1 | dwelling_condition3==1
rename fuel_payment3 fuel_payment
rename hhbill_september hhbill
rename notice_september notice
rename disconnect_september disconnect
rename electronic_device3 electronic_device
rename energybill_change3 energybill_change
rename stimulus_september stimulus
rename energy_assistance_september energy_assistance
rename gov_agency_september gov_agency
rename energy_provider_september energy_provider
rename friend_family_september friend_family
rename faith_org_september faith_org
rename nonprofit_september nonprofit
rename payday_lender_september payday_lender
rename bankloan_september bankloan
rename gov_assistance_september gov_assistance
rename forego_expenses_september forego_expenses
rename wap_september wap
rename liheap_september liheap
rename snap_september snap
rename tanf_september tanf
rename ssi_september ssi
rename medicaid_september medicaid
rename vet_benefits_september vet_benefits
rename unemp_insurance_september unemp_insurance
rename stove_5mos stove
rename spaceheater_5mos spaceheater
rename woodstove_5mos woodstove
rename fireplace_5mos fireplace
rename hotshower_5mos hotshower
rename burntrash_5mos burntrash
rename heavycoat_5mos heavycoat
rename boughtice_5mos boughtice
rename coldshowers_5mos coldshower
rename dryer_5mos dryer
rename centralac_5mos centralac
rename windowac_5mos windowac
rename fan_5mos fan
rename dehumidifier_5mos dehumidifier
rename lefthouse_5mos lefthouse
rename openedwindows_5mos openedwindows
rename covid_employment3 covid_employment
rename covid_rent3 covid_rent
rename covid_feedfamily3 covid_feedfamily
rename covid_medicalcare3 covid_medicalcare
rename covid_lostinsurance3 covid_lostinsurance
rename date_unemployed3 date_unemployed
rename employed3 employed
rename unemployed3 unemployed
rename employ3 employ
rename efficient_appliances3 efficient_appliances
rename efficient_insulation3 efficient_insulation
rename efficient_ac3 efficient_ac
rename efficient_smartmeter3 efficient_smartmeter
rename efficient_lights3 efficient_lights
rename efficient_hometemp3 efficient_hometemp
rename efficient_devices3 efficient_devices
rename efficient_hungwindow3 efficient_hungwindow
rename utilitypay_check3 utilitypay_check
rename utilitypay_credit3 utilitypay_credit
rename utilitypay_debit3 utilitypay_debite
rename utilitypay_withdrawal3 utilitypay_withdrawal
rename utilitypay_cash3 utilitypay_cash
rename utilitybill_pay3 utilitybill_pay
rename utilityhelp_friend3 utilityhelp_friend
rename utilityhelp_paydayloan3 utilityhelp_paydayloan
rename utilityhelp_credit3 utilityhelp_credit
rename utilityhelp_notice3 utilityhelp_notice
rename utility_debt3 utility_debt
rename debt_over10003 debt_over1000
rename behind_rent3 behind_rent
rename behind_credit3 behind_credit
rename behind_car3 behind_car
rename behind_medical3 behind_medical
rename behind_bankloan3 behind_bankloan
rename behind_personalloan3 behind_personalloan
rename behind_studentloan3 behind_studentloan
rename evictnotice_september evict_notice
rename evicted_september evicted
rename legal_help3 legal_help
rename legal_access3 legal_access
rename legal_source3 legal_source
rename generalhealth_rate3 generalhealth_rate
rename prescription3 prescription
rename fill_prescription3 fill_prescription
rename mentalhealth_days3 mentalhealth_days
rename highbloodpressure3 highbloodpressure
rename heartdisease3 heartdisease
rename diabetes3 diabetes
rename cancer3 cancer
rename obesity3 obesity
rename asthma3 asthma
rename skipped_meals3 skipped_meals
rename skipped_meals_frequency3 skipped_meals_frequency
rename water_bill3 water_bill
rename water_shutoff3 water_shutoff
rename hh1_income3 hh1_income
rename hh2_income3 hh2_income
rename hh3_income3 hh3_income
rename hh4_income3 hh4_income
rename hh5_income3 hh5_income
rename hh6_income3 hh6_income
rename hh7_income3 hh7_income
rename hh8_income3 hh8_income
rename income3 income
rename sought_govagency3 sought_govagency
rename sought_bank3 sought_bank
rename sought_payday3 sought_payday
rename sought_utility3 sought_utility
rename sought_nonprofit3 sought_nonprofit
rename sought_faithbased3 sought_faithbased
rename sought_family_friends3 sought_family_friends
rename form_call3 form_call
rename form_letter3 form_letter 
rename form_doorknock3 form_doorknock 
rename form_email3 form_email 
rename form_text3 form_text
rename response_contactutility3 response_contactutility
rename response_paymentplan3 response_paymentplan
rename response_legalservices3 response_legalservices
rename response_assistance3 response_assistance
rename response_internet3 response_internet
rename response_homechanges3 response_homechanges
rename response_reduceenergy3 response_reduceenergy
rename response_moved3 response_moved
rename reconnection_cost3 reconnection_cost
rename response_moved_temp3 response_moved_temp
rename response_moved_perm3 response_moved_perm
rename response_livedwithout3 response_livedwithout
rename response_otherhelp3 response_otherhelp
rename response_paidoff3 response_paidoff
rename response_usedothers3 response_usedothers
rename response_carorbattery3 response_carorbattery
rename no_ac3 no_ac
rename no_ac_reason3 no_ac_reason




save september_energy_insecurity.dta, replace


clear


******october Data******
use COMBINED_waves_1234.dta, replace
keep weight3 weight4 caseid_National caseid_Indiana caseid_w1 inputzip3 marstat state utility_type muni iou coop electricity3 gas3 wood3 propane3 fueloil3 age hhsize3 hh_under53 any_under53 any_over653 hh_over653 covid_lostwork3 covid_insurance3 covid_lessinsurance3 no_insurance3 any_disability3 home_trailer3 home_apartmentcondo3 home_singlefam3 home_other3 utilitybill_pay_irregular3 utilitydebt_over1003 genhealth_goodtogreat3 hh_disability3 educ3 educ_HS3 homeowner3 ownhome3 retired race white black hispanic native_american female hhinc3 fpl3 under_100_fpl3 FPL_100_1503 FPL_150_2003 dwelling_type1  dwelling_type2 dwelling_type3 poor_insulation1 drafty1 mold1 holes1 plumbing1 exposed_sockets1 nonworking_stove_fridge1 broken_ac1 poor_insulation2 drafty2 mold2 holes2 plumbing2 exposed_sockets2 nonworking_stove_fridge2 broken_ac2 poor_insulation3 drafty3 mold3 holes3 plumbing3 exposed_sockets3 nonworking_stove_fridge3 broken_ac3 trust_energyco3 dwelling_condition1 dwelling_condition2 dwelling_condition3 fuel_payment3 hhbill_october notice_october disconnect_october electronic_device3 energybill_change3 stimulus_october energy_assistance_october gov_agency_october energy_provider_october friend_family_october faith_org_october nonprofit_october payday_lender_october bankloan_october gov_assistance_october forego_expenses_october wap_october liheap_october snap_october tanf_october ssi_october medicaid_october vet_benefits_october unemp_insurance_october gov_assistance_october stove_5mos spaceheater_5mos woodstove_5mos fireplace_5mos hotshower_5mos burntrash_5mos heavycoat_5mos boughtice_5mos coldshowers_5mos dryer_5mos centralac_5mos windowac_5mos fan_5mos dehumidifier_5mos lefthouse_5mos openedwindows_5mos covid_employment3 covid_rent3 covid_feedfamily3 covid_medicalcare3 covid_lostinsurance3 date_unemployed3 employed3 unemployed3 employ3 efficient_appliances3 efficient_insulation3 efficient_ac3 efficient_smartmeter3 efficient_lights3 efficient_hometemp3 efficient_devices3 efficient_hungwindow3 utilitypay_check3 utilitypay_credit3 utilitypay_debit3 utilitypay_withdrawal3 utilitypay_cash3 utilitybill_pay3 utilityhelp_friend3 utilityhelp_paydayloan3 utilityhelp_credit3 utilityhelp_notice3 utility_debt3 debt_over10003 behind_rent3 behind_credit3 behind_car3 behind_medical3 behind_bankloan3 behind_personalloan3 behind_studentloan3 evictnotice_october evicted_october legal_help3 legal_access3 legal_source3 generalhealth_rate3 prescription3 fill_prescription3 mentalhealth_days3 highbloodpressure3 heartdisease3 diabetes3 cancer3 obesity3 asthma3 skipped_meals3 skipped_meals_frequency3 water_bill3 water_shutoff3 hh1_income3 hh2_income3 hh3_income3 hh4_income3 hh5_income3 hh6_income3 hh7_income3 hh8_income3 income3 dwelling_open3 maintainbills_open3 debt_over1000_open3 chronic_conditions_open3 covid_employmentchange_open3 utilitybillpay_open3 utilitybillhelp_open3 utilitypaymethod_open3 staycool_open3 staywarm_open3 govassist_open3 energyassist_open3 response_notice_open3 energyefficiency_open3 sought_govagency3 sought_bank3 sought_payday3 sought_utility3 sought_nonprofit3 sought_faithbased3 sought_family_friends3 form_call3 form_letter3 form_doorknock3 form_email3 form_text3  response_contactutility3 response_paymentplan3 response_legalservices3 response_assistance3 response_internet3 response_homechanges3 response_reduceenergy3 response_moved3 reconnection_cost3 response_moved_temp3 response_moved_perm3 response_livedwithout3 response_otherhelp3 response_paidoff3 response_usedothers3 response_carorbattery3 no_ac3 no_ac_reason3


drop if hhbill_october==.

gen month=6
gen wave=3

rename weight3 weight
rename weight4 weight_balanced
rename inputzip3 zip
rename electricity3 electricity
rename gas3 gas
rename wood3 wood
rename propane3 propane
rename fueloil3 fueloil
rename hhsize3 hhsize
rename hh_under53 hh_under5
rename hh_over653 hh_over65
rename any_under53 any_under5
rename any_over653 any_over65
rename covid_lostwork3 covid_lostwork
rename covid_insurance3 covid_insurance
rename covid_lessinsurance3 covid_lessinsurance
rename no_insurance3 no_insurance
rename any_disability3 any_disability
rename home_trailer3 home_trailer
rename home_apartmentcondo3 home_apartmentcondo
rename home_singlefam3 home_singlefam
rename home_other3 home_other
rename utilitybill_pay_irregular3 utilitybill_pay_irregular
rename utilitydebt_over1003 utility_debt_over100
rename genhealth_goodtogreat3 genhealth_goodtogreat
rename hh_disability3 hh_disability
rename educ3 educ
rename educ_HS3 educ_HS
rename homeowner3 homeowner
rename ownhome3 ownhome
rename hhinc3 hhinc
rename fpl3 fpl
rename under_100_fpl3 under_100_fpl
rename FPL_100_1503 FPL_100_150
rename FPL_150_2003 FPL_150_200
rename dwelling_type1 dwelling_type
gen poor_insulation=0
replace poor_insulation=1 if poor_insulation1==1 | poor_insulation2==1 | poor_insulation3==1
gen drafty=0
replace drafty=1 if drafty1==1 | drafty2==1 | drafty3==1
gen mold=0
replace mold=1 if mold1==1 | mold2==1 | mold3==1
gen holes=0
replace holes=1 if holes1==1 | holes2==1 | holes3==1
gen plumbing=0
replace plumbing=1 if plumbing1==1 | plumbing2==1 | plumbing3==1
gen exposed_sockets=0
replace exposed_sockets=1 if exposed_sockets1==1 | exposed_sockets2==1 | exposed_sockets3==1
gen nonworking_stove_fridge=0
replace nonworking_stove_fridge=1 if nonworking_stove_fridge1==1 | nonworking_stove_fridge2==1 | nonworking_stove_fridge3==1
gen broken_ac=0
replace broken_ac=1 if broken_ac1==1 | broken_ac2==1 | broken_ac3==1
rename trust_energyco3 trust_energyco
gen dwelling_condition=0
replace dwelling_condition=1 if dwelling_condition1==1 | dwelling_condition2==1 | dwelling_condition3==1
rename fuel_payment3 fuel_payment
rename hhbill_october hhbill
rename notice_october notice
rename disconnect_october disconnect
rename electronic_device3 electronic_device
rename energybill_change3 energybill_change
rename stimulus_october stimulus
rename energy_assistance_october energy_assistance
rename gov_agency_october gov_agency
rename energy_provider_october energy_provider
rename friend_family_october friend_family
rename faith_org_october faith_org
rename nonprofit_october nonprofit
rename payday_lender_october payday_lender
rename bankloan_october bankloan
rename gov_assistance_october gov_assistance
rename forego_expenses_october forego_expenses
rename wap_october wap
rename liheap_october liheap
rename snap_october snap
rename tanf_october tanf
rename ssi_october ssi
rename medicaid_october medicaid
rename vet_benefits_october vet_benefits
rename unemp_insurance_october unemp_insurance
rename stove_5mos stove
rename spaceheater_5mos spaceheater
rename woodstove_5mos woodstove
rename fireplace_5mos fireplace
rename hotshower_5mos hotshower
rename burntrash_5mos burntrash
rename heavycoat_5mos heavycoat
rename boughtice_5mos boughtice
rename coldshowers_5mos coldshower
rename dryer_5mos dryer
rename centralac_5mos centralac
rename windowac_5mos windowac
rename fan_5mos fan
rename dehumidifier_5mos dehumidifier
rename lefthouse_5mos lefthouse
rename openedwindows_5mos openedwindows
rename covid_employment3 covid_employment
rename covid_rent3 covid_rent
rename covid_feedfamily3 covid_feedfamily
rename covid_medicalcare3 covid_medicalcare
rename covid_lostinsurance3 covid_lostinsurance
rename date_unemployed3 date_unemployed
rename employed3 employed
rename unemployed3 unemployed
rename employ3 employ
rename efficient_appliances3 efficient_appliances
rename efficient_insulation3 efficient_insulation
rename efficient_ac3 efficient_ac
rename efficient_smartmeter3 efficient_smartmeter
rename efficient_lights3 efficient_lights
rename efficient_hometemp3 efficient_hometemp
rename efficient_devices3 efficient_devices
rename efficient_hungwindow3 efficient_hungwindow
rename utilitypay_check3 utilitypay_check
rename utilitypay_credit3 utilitypay_credit
rename utilitypay_debit3 utilitypay_debite
rename utilitypay_withdrawal3 utilitypay_withdrawal
rename utilitypay_cash3 utilitypay_cash
rename utilitybill_pay3 utilitybill_pay
rename utilityhelp_friend3 utilityhelp_friend
rename utilityhelp_paydayloan3 utilityhelp_paydayloan
rename utilityhelp_credit3 utilityhelp_credit
rename utilityhelp_notice3 utilityhelp_notice
rename utility_debt3 utility_debt
rename debt_over10003 debt_over1000
rename behind_rent3 behind_rent
rename behind_credit3 behind_credit
rename behind_car3 behind_car
rename behind_medical3 behind_medical
rename behind_bankloan3 behind_bankloan
rename behind_personalloan3 behind_personalloan
rename behind_studentloan3 behind_studentloan
rename evictnotice_october evict_notice
rename evicted_october evicted
rename legal_help3 legal_help
rename legal_access3 legal_access
rename legal_source3 legal_source
rename generalhealth_rate3 generalhealth_rate
rename prescription3 prescription
rename fill_prescription3 fill_prescription
rename mentalhealth_days3 mentalhealth_days
rename highbloodpressure3 highbloodpressure
rename heartdisease3 heartdisease
rename diabetes3 diabetes
rename cancer3 cancer
rename obesity3 obesity
rename asthma3 asthma
rename skipped_meals3 skipped_meals
rename skipped_meals_frequency3 skipped_meals_frequency
rename water_bill3 water_bill
rename water_shutoff3 water_shutoff
rename hh1_income3 hh1_income
rename hh2_income3 hh2_income
rename hh3_income3 hh3_income
rename hh4_income3 hh4_income
rename hh5_income3 hh5_income
rename hh6_income3 hh6_income
rename hh7_income3 hh7_income
rename hh8_income3 hh8_income
rename income3 income
rename sought_govagency3 sought_govagency
rename sought_bank3 sought_bank
rename sought_payday3 sought_payday
rename sought_utility3 sought_utility
rename sought_nonprofit3 sought_nonprofit
rename sought_faithbased3 sought_faithbased
rename sought_family_friends3 sought_family_friends
rename form_call3 form_call
rename form_letter3 form_letter 
rename form_doorknock3 form_doorknock 
rename form_email3 form_email 
rename form_text3 form_text
rename response_contactutility3 response_contactutility
rename response_paymentplan3 response_paymentplan
rename response_legalservices3 response_legalservices
rename response_assistance3 response_assistance
rename response_internet3 response_internet
rename response_homechanges3 response_homechanges
rename response_reduceenergy3 response_reduceenergy
rename response_moved3 response_moved
rename reconnection_cost3 reconnection_cost
rename response_moved_temp3 response_moved_temp
rename response_moved_perm3 response_moved_perm
rename response_livedwithout3 response_livedwithout
rename response_otherhelp3 response_otherhelp
rename response_paidoff3 response_paidoff
rename response_usedothers3 response_usedothers
rename response_carorbattery3 response_carorbattery
rename no_ac3 no_ac
rename no_ac_reason3 no_ac_reason

save october_energy_insecurity.dta, replace

clear


******november Data******
use COMBINED_waves_1234.dta, replace
keep weight3 weight4 caseid_National caseid_Indiana caseid_w1 inputzip3 marstat state utility_type muni iou coop electricity3 gas3 wood3 propane3 fueloil3 age hhsize3 hh_under53 any_under53 any_over653 hh_over653 covid_lostwork3 covid_insurance3 covid_lessinsurance3 no_insurance3 any_disability3 home_trailer3 home_apartmentcondo3 home_singlefam3 home_other3 utilitybill_pay_irregular3 utilitydebt_over1003 genhealth_goodtogreat3 hh_disability3 educ3 educ_HS3 homeowner3 ownhome3 retired race white black hispanic native_american female hhinc3 fpl3 under_100_fpl3 FPL_100_1503 FPL_150_2003 dwelling_type1 dwelling_type2 dwelling_type3 poor_insulation1 drafty1 mold1 holes1 plumbing1 exposed_sockets1 nonworking_stove_fridge1 broken_ac1 poor_insulation2 drafty2 mold2 holes2 plumbing2 exposed_sockets2 nonworking_stove_fridge2 broken_ac2 poor_insulation3 drafty3 mold3 holes3 plumbing3 exposed_sockets3 nonworking_stove_fridge3 broken_ac3 trust_energyco3 dwelling_condition1 dwelling_condition2 dwelling_condition3 fuel_payment3 hhbill_november notice_november disconnect_november electronic_device3 energybill_change3 stimulus_november energy_assistance_november gov_agency_november energy_provider_november friend_family_november faith_org_november nonprofit_november payday_lender_november bankloan_november gov_assistance_november forego_expenses_november wap_november liheap_november snap_november tanf_november ssi_november medicaid_november vet_benefits_november unemp_insurance_november gov_assistance_november stove_5mos spaceheater_5mos woodstove_5mos fireplace_5mos hotshower_5mos burntrash_5mos heavycoat_5mos boughtice_5mos coldshowers_5mos dryer_5mos centralac_5mos windowac_5mos fan_5mos dehumidifier_5mos lefthouse_5mos openedwindows_5mos covid_employment3 covid_rent3 covid_feedfamily3 covid_medicalcare3 covid_lostinsurance3 date_unemployed3 employed3 unemployed3 employ3 efficient_appliances3 efficient_insulation3 efficient_ac3 efficient_smartmeter3 efficient_lights3 efficient_hometemp3 efficient_devices3 efficient_hungwindow3 utilitypay_check3 utilitypay_credit3 utilitypay_debit3 utilitypay_withdrawal3 utilitypay_cash3 utilitybill_pay3 utilityhelp_friend3 utilityhelp_paydayloan3 utilityhelp_credit3 utilityhelp_notice3 utility_debt3 debt_over10003 behind_rent3 behind_credit3 behind_car3 behind_medical3 behind_bankloan3 behind_personalloan3 behind_studentloan3 evictnotice_november evicted_november legal_help3 legal_access3 legal_source3 generalhealth_rate3 prescription3 fill_prescription3 mentalhealth_days3 highbloodpressure3 heartdisease3 diabetes3 cancer3 obesity3 asthma3 skipped_meals3 skipped_meals_frequency3 water_bill3 water_shutoff3 hh1_income3 hh2_income3 hh3_income3 hh4_income3 hh5_income3 hh6_income3 hh7_income3 hh8_income3 income3 dwelling_open3 maintainbills_open3 debt_over1000_open3 chronic_conditions_open3 covid_employmentchange_open3 utilitybillpay_open3 utilitybillhelp_open3 utilitypaymethod_open3 staycool_open3 staywarm_open3 govassist_open3 energyassist_open3 response_notice_open3 energyefficiency_open3 sought_govagency3 sought_bank3 sought_payday3 sought_utility3 sought_nonprofit3 sought_faithbased3 sought_family_friends3 form_call3 form_letter3 form_doorknock3 form_email3 form_text3  response_contactutility3 response_paymentplan3 response_legalservices3 response_assistance3 response_internet3 response_homechanges3 response_reduceenergy3 response_moved3 reconnection_cost3 response_moved_temp3 response_moved_perm3 response_livedwithout3 response_otherhelp3 response_paidoff3 response_usedothers3 response_carorbattery3 no_ac3 no_ac_reason3


drop if hhbill_november==.

gen month=7
gen wave=3

rename weight3 weight
rename weight4 weight_balanced
rename inputzip3 zip
rename electricity3 electricity
rename gas3 gas
rename wood3 wood
rename propane3 propane
rename fueloil3 fueloil
rename hhsize3 hhsize
rename hh_under53 hh_under5
rename hh_over653 hh_over65
rename any_under53 any_under5
rename any_over653 any_over65
rename covid_lostwork3 covid_lostwork
rename covid_insurance3 covid_insurance
rename covid_lessinsurance3 covid_lessinsurance
rename no_insurance3 no_insurance
rename any_disability3 any_disability
rename home_trailer3 home_trailer
rename home_apartmentcondo3 home_apartmentcondo
rename home_singlefam3 home_singlefam
rename home_other3 home_other
rename utilitybill_pay_irregular3 utilitybill_pay_irregular
rename utilitydebt_over1003 utility_debt_over100
rename genhealth_goodtogreat3 genhealth_goodtogreat
rename hh_disability3 hh_disability
rename educ3 educ
rename educ_HS3 educ_HS
rename homeowner3 homeowner
rename ownhome3 ownhome
rename hhinc3 hhinc
rename fpl3 fpl
rename under_100_fpl3 under_100_fpl
rename FPL_100_1503 FPL_100_150
rename FPL_150_2003 FPL_150_200
rename dwelling_type1 dwelling_type
gen poor_insulation=0
replace poor_insulation=1 if poor_insulation1==1 | poor_insulation2==1 | poor_insulation3==1
gen drafty=0
replace drafty=1 if drafty1==1 | drafty2==1 | drafty3==1
gen mold=0
replace mold=1 if mold1==1 | mold2==1 | mold3==1
gen holes=0
replace holes=1 if holes1==1 | holes2==1 | holes3==1
gen plumbing=0
replace plumbing=1 if plumbing1==1 | plumbing2==1 | plumbing3==1
gen exposed_sockets=0
replace exposed_sockets=1 if exposed_sockets1==1 | exposed_sockets2==1 | exposed_sockets3==1
gen nonworking_stove_fridge=0
replace nonworking_stove_fridge=1 if nonworking_stove_fridge1==1 | nonworking_stove_fridge2==1 | nonworking_stove_fridge3==1
gen broken_ac=0
replace broken_ac=1 if broken_ac1==1 | broken_ac2==1 | broken_ac3==1
rename trust_energyco3 trust_energyco
gen dwelling_condition=0
replace dwelling_condition=1 if dwelling_condition1==1 | dwelling_condition2==1 | dwelling_condition3==1
rename fuel_payment3 fuel_payment
rename hhbill_november hhbill
rename notice_november notice
rename disconnect_november disconnect
rename electronic_device3 electronic_device
rename energybill_change3 energybill_change
rename stimulus_november stimulus
rename energy_assistance_november energy_assistance
rename gov_agency_november gov_agency
rename energy_provider_november energy_provider
rename friend_family_november friend_family
rename faith_org_november faith_org
rename nonprofit_november nonprofit
rename payday_lender_november payday_lender
rename bankloan_november bankloan
rename gov_assistance_november gov_assistance
rename forego_expenses_november forego_expenses
rename wap_november wap
rename liheap_november liheap
rename snap_november snap
rename tanf_november tanf
rename ssi_november ssi
rename medicaid_november medicaid
rename vet_benefits_november vet_benefits
rename unemp_insurance_november unemp_insurance
rename stove_5mos stove
rename spaceheater_5mos spaceheater
rename woodstove_5mos woodstove
rename fireplace_5mos fireplace
rename hotshower_5mos hotshower
rename burntrash_5mos burntrash
rename heavycoat_5mos heavycoat
rename boughtice_5mos boughtice
rename coldshowers_5mos coldshower
rename dryer_5mos dryer
rename centralac_5mos centralac
rename windowac_5mos windowac
rename fan_5mos fan
rename dehumidifier_5mos dehumidifier
rename lefthouse_5mos lefthouse
rename openedwindows_5mos openedwindows
rename covid_employment3 covid_employment
rename covid_rent3 covid_rent
rename covid_feedfamily3 covid_feedfamily
rename covid_medicalcare3 covid_medicalcare
rename covid_lostinsurance3 covid_lostinsurance
rename date_unemployed3 date_unemployed
rename employed3 employed
rename unemployed3 unemployed
rename employ3 employ
rename efficient_appliances3 efficient_appliances
rename efficient_insulation3 efficient_insulation
rename efficient_ac3 efficient_ac
rename efficient_smartmeter3 efficient_smartmeter
rename efficient_lights3 efficient_lights
rename efficient_hometemp3 efficient_hometemp
rename efficient_devices3 efficient_devices
rename efficient_hungwindow3 efficient_hungwindow
rename utilitypay_check3 utilitypay_check
rename utilitypay_credit3 utilitypay_credit
rename utilitypay_debit3 utilitypay_debite
rename utilitypay_withdrawal3 utilitypay_withdrawal
rename utilitypay_cash3 utilitypay_cash
rename utilitybill_pay3 utilitybill_pay
rename utilityhelp_friend3 utilityhelp_friend
rename utilityhelp_paydayloan3 utilityhelp_paydayloan
rename utilityhelp_credit3 utilityhelp_credit
rename utilityhelp_notice3 utilityhelp_notice
rename utility_debt3 utility_debt
rename debt_over10003 debt_over1000
rename behind_rent3 behind_rent
rename behind_credit3 behind_credit
rename behind_car3 behind_car
rename behind_medical3 behind_medical
rename behind_bankloan3 behind_bankloan
rename behind_personalloan3 behind_personalloan
rename behind_studentloan3 behind_studentloan
rename evictnotice_november evict_notice
rename evicted_november evicted
rename legal_help3 legal_help
rename legal_access3 legal_access
rename legal_source3 legal_source
rename generalhealth_rate3 generalhealth_rate
rename prescription3 prescription
rename fill_prescription3 fill_prescription
rename mentalhealth_days3 mentalhealth_days
rename highbloodpressure3 highbloodpressure
rename heartdisease3 heartdisease
rename diabetes3 diabetes
rename cancer3 cancer
rename obesity3 obesity
rename asthma3 asthma
rename skipped_meals3 skipped_meals
rename skipped_meals_frequency3 skipped_meals_frequency
rename water_bill3 water_bill
rename water_shutoff3 water_shutoff
rename hh1_income3 hh1_income
rename hh2_income3 hh2_income
rename hh3_income3 hh3_income
rename hh4_income3 hh4_income
rename hh5_income3 hh5_income
rename hh6_income3 hh6_income
rename hh7_income3 hh7_income
rename hh8_income3 hh8_income
rename income3 income
rename sought_govagency3 sought_govagency
rename sought_bank3 sought_bank
rename sought_payday3 sought_payday
rename sought_utility3 sought_utility
rename sought_nonprofit3 sought_nonprofit
rename sought_faithbased3 sought_faithbased
rename sought_family_friends3 sought_family_friends
rename form_call3 form_call
rename form_letter3 form_letter 
rename form_doorknock3 form_doorknock 
rename form_email3 form_email 
rename form_text3 form_text
rename response_contactutility3 response_contactutility
rename response_paymentplan3 response_paymentplan
rename response_legalservices3 response_legalservices
rename response_assistance3 response_assistance
rename response_internet3 response_internet
rename response_homechanges3 response_homechanges
rename response_reduceenergy3 response_reduceenergy
rename response_moved3 response_moved
rename reconnection_cost3 reconnection_cost
rename response_moved_temp3 response_moved_temp
rename response_moved_perm3 response_moved_perm
rename response_livedwithout3 response_livedwithout
rename response_otherhelp3 response_otherhelp
rename response_paidoff3 response_paidoff
rename response_usedothers3 response_usedothers
rename response_carorbattery3 response_carorbattery
rename no_ac3 no_ac
rename no_ac_reason3 no_ac_reason

save november_energy_insecurity.dta, replace

clear



******december Data******
use COMBINED_waves_1234.dta, replace
keep weight3 weight4 caseid_National caseid_Indiana caseid_w1 inputzip3 marstat state utility_type muni iou coop electricity3 gas3 wood3 propane3 fueloil3 age hhsize3 hh_under53 any_under53 any_over653 hh_over653 covid_lostwork3 covid_insurance3 covid_lessinsurance3 no_insurance3 any_disability3 home_trailer3 home_apartmentcondo3 home_singlefam3 home_other3 utilitybill_pay_irregular3 utilitydebt_over1003 genhealth_goodtogreat3 hh_disability3 educ3 educ_HS3 homeowner3 ownhome3 retired race white black hispanic native_american female hhinc3 fpl3 under_100_fpl3 FPL_100_1503 FPL_150_2003 dwelling_type1 dwelling_type2 dwelling_type3 poor_insulation1 drafty1 mold1 holes1 plumbing1 exposed_sockets1 nonworking_stove_fridge1 broken_ac1 poor_insulation2 drafty2 mold2 holes2 plumbing2 exposed_sockets2 nonworking_stove_fridge2 broken_ac2 poor_insulation3 drafty3 mold3 holes3 plumbing3 exposed_sockets3 nonworking_stove_fridge3 broken_ac3 trust_energyco3 dwelling_condition1 dwelling_condition2 dwelling_condition3 fuel_payment3 hhbill_december notice_december disconnect_december electronic_device3 energybill_change3 stimulus_december energy_assistance_december gov_agency_december energy_provider_december friend_family_december faith_org_december nonprofit_december payday_lender_december bankloan_december gov_assistance_december forego_expenses_december wap_december liheap_december snap_december tanf_december ssi_december medicaid_december vet_benefits_december unemp_insurance_december gov_assistance_december stove_5mos spaceheater_5mos woodstove_5mos fireplace_5mos hotshower_5mos burntrash_5mos heavycoat_5mos boughtice_5mos coldshowers_5mos dryer_5mos centralac_5mos windowac_5mos fan_5mos dehumidifier_5mos lefthouse_5mos openedwindows_5mos covid_employment3 covid_rent3 covid_feedfamily3 covid_medicalcare3 covid_lostinsurance3 date_unemployed3 employed3 unemployed3 employ3 efficient_appliances3 efficient_insulation3 efficient_ac3 efficient_smartmeter3 efficient_lights3 efficient_hometemp3 efficient_devices3 efficient_hungwindow3 utilitypay_check3 utilitypay_credit3 utilitypay_debit3 utilitypay_withdrawal3 utilitypay_cash3 utilitybill_pay3 utilityhelp_friend3 utilityhelp_paydayloan3 utilityhelp_credit3 utilityhelp_notice3 utility_debt3 debt_over10003 behind_rent3 behind_credit3 behind_car3 behind_medical3 behind_bankloan3 behind_personalloan3 behind_studentloan3 evictnotice_december evicted_december legal_help3 legal_access3 legal_source3 generalhealth_rate3 prescription3 fill_prescription3 mentalhealth_days3 highbloodpressure3 heartdisease3 diabetes3 cancer3 obesity3 asthma3 skipped_meals3 skipped_meals_frequency3 water_bill3 water_shutoff3 hh1_income3 hh2_income3 hh3_income3 hh4_income3 hh5_income3 hh6_income3 hh7_income3 hh8_income3 income3 dwelling_open3 maintainbills_open3 debt_over1000_open3 chronic_conditions_open3 covid_employmentchange_open3 utilitybillpay_open3 utilitybillhelp_open3 utilitypaymethod_open3 staycool_open3 staywarm_open3 govassist_open3 energyassist_open3 response_notice_open3 energyefficiency_open3 sought_govagency3 sought_bank3 sought_payday3 sought_utility3 sought_nonprofit3 sought_faithbased3 sought_family_friends3 form_call3 form_letter3 form_doorknock3 form_email3 form_text3  response_contactutility3 response_paymentplan3 response_legalservices3 response_assistance3 response_internet3 response_homechanges3 response_reduceenergy3 response_moved3 reconnection_cost3 response_moved_temp3 response_moved_perm3 response_livedwithout3 response_otherhelp3 response_paidoff3 response_usedothers3 response_carorbattery3 no_ac3 no_ac_reason3


drop if hhbill_december==.

gen month=8
gen wave=3

rename weight3 weight
rename weight4 weight_balanced
rename inputzip3 zip
rename electricity3 electricity
rename gas3 gas
rename wood3 wood
rename propane3 propane
rename fueloil3 fueloil
rename hhsize3 hhsize
rename hh_under53 hh_under5
rename hh_over653 hh_over65
rename any_under53 any_under5
rename any_over653 any_over65
rename covid_lostwork3 covid_lostwork
rename covid_insurance3 covid_insurance
rename covid_lessinsurance3 covid_lessinsurance
rename no_insurance3 no_insurance
rename any_disability3 any_disability
rename home_trailer3 home_trailer
rename home_apartmentcondo3 home_apartmentcondo
rename home_singlefam3 home_singlefam
rename home_other3 home_other
rename utilitybill_pay_irregular3 utilitybill_pay_irregular
rename utilitydebt_over1003 utility_debt_over100
rename genhealth_goodtogreat3 genhealth_goodtogreat
rename hh_disability3 hh_disability
rename educ3 educ
rename educ_HS3 educ_HS
rename homeowner3 homeowner
rename ownhome3 ownhome
rename hhinc3 hhinc
rename fpl3 fpl
rename under_100_fpl3 under_100_fpl
rename FPL_100_1503 FPL_100_150
rename FPL_150_2003 FPL_150_200
rename dwelling_type1 dwelling_type
gen poor_insulation=0
replace poor_insulation=1 if poor_insulation1==1 | poor_insulation2==1 | poor_insulation3==1
gen drafty=0
replace drafty=1 if drafty1==1 | drafty2==1 | drafty3==1
gen mold=0
replace mold=1 if mold1==1 | mold2==1 | mold3==1
gen holes=0
replace holes=1 if holes1==1 | holes2==1 | holes3==1
gen plumbing=0
replace plumbing=1 if plumbing1==1 | plumbing2==1 | plumbing3==1
gen exposed_sockets=0
replace exposed_sockets=1 if exposed_sockets1==1 | exposed_sockets2==1 | exposed_sockets3==1
gen nonworking_stove_fridge=0
replace nonworking_stove_fridge=1 if nonworking_stove_fridge1==1 | nonworking_stove_fridge2==1 | nonworking_stove_fridge3==1
gen broken_ac=0
replace broken_ac=1 if broken_ac1==1 | broken_ac2==1 | broken_ac3==1
rename trust_energyco3 trust_energyco
gen dwelling_condition=0
replace dwelling_condition=1 if dwelling_condition1==1 | dwelling_condition2==1 | dwelling_condition3==1
rename fuel_payment3 fuel_payment
rename hhbill_december hhbill
rename notice_december notice
rename disconnect_december disconnect
rename electronic_device3 electronic_device
rename energybill_change3 energybill_change
rename stimulus_december stimulus
rename energy_assistance_december energy_assistance
rename gov_agency_december gov_agency
rename energy_provider_december energy_provider
rename friend_family_december friend_family
rename faith_org_december faith_org
rename nonprofit_december nonprofit
rename payday_lender_december payday_lender
rename bankloan_december bankloan
rename gov_assistance_december gov_assistance
rename forego_expenses_december forego_expenses
rename wap_december wap
rename liheap_december liheap
rename snap_december snap
rename tanf_december tanf
rename ssi_december ssi
rename medicaid_december medicaid
rename vet_benefits_december vet_benefits
rename unemp_insurance_december unemp_insurance
rename stove_5mos stove
rename spaceheater_5mos spaceheater
rename woodstove_5mos woodstove
rename fireplace_5mos fireplace
rename hotshower_5mos hotshower
rename burntrash_5mos burntrash
rename heavycoat_5mos heavycoat
rename boughtice_5mos boughtice
rename coldshowers_5mos coldshower
rename dryer_5mos dryer
rename centralac_5mos centralac
rename windowac_5mos windowac
rename fan_5mos fan
rename dehumidifier_5mos dehumidifier
rename lefthouse_5mos lefthouse
rename openedwindows_5mos openedwindows
rename covid_employment3 covid_employment
rename covid_rent3 covid_rent
rename covid_feedfamily3 covid_feedfamily
rename covid_medicalcare3 covid_medicalcare
rename covid_lostinsurance3 covid_lostinsurance
rename date_unemployed3 date_unemployed
rename employed3 employed
rename unemployed3 unemployed
rename employ3 employ
rename efficient_appliances3 efficient_appliances
rename efficient_insulation3 efficient_insulation
rename efficient_ac3 efficient_ac
rename efficient_smartmeter3 efficient_smartmeter
rename efficient_lights3 efficient_lights
rename efficient_hometemp3 efficient_hometemp
rename efficient_devices3 efficient_devices
rename efficient_hungwindow3 efficient_hungwindow
rename utilitypay_check3 utilitypay_check
rename utilitypay_credit3 utilitypay_credit
rename utilitypay_debit3 utilitypay_debite
rename utilitypay_withdrawal3 utilitypay_withdrawal
rename utilitypay_cash3 utilitypay_cash
rename utilitybill_pay3 utilitybill_pay
rename utilityhelp_friend3 utilityhelp_friend
rename utilityhelp_paydayloan3 utilityhelp_paydayloan
rename utilityhelp_credit3 utilityhelp_credit
rename utilityhelp_notice3 utilityhelp_notice
rename utility_debt3 utility_debt
rename debt_over10003 debt_over1000
rename behind_rent3 behind_rent
rename behind_credit3 behind_credit
rename behind_car3 behind_car
rename behind_medical3 behind_medical
rename behind_bankloan3 behind_bankloan
rename behind_personalloan3 behind_personalloan
rename behind_studentloan3 behind_studentloan
rename evictnotice_december evict_notice
rename evicted_december evicted
rename legal_help3 legal_help
rename legal_access3 legal_access
rename legal_source3 legal_source
rename generalhealth_rate3 generalhealth_rate
rename prescription3 prescription
rename fill_prescription3 fill_prescription
rename mentalhealth_days3 mentalhealth_days
rename highbloodpressure3 highbloodpressure
rename heartdisease3 heartdisease
rename diabetes3 diabetes
rename cancer3 cancer
rename obesity3 obesity
rename asthma3 asthma
rename skipped_meals3 skipped_meals
rename skipped_meals_frequency3 skipped_meals_frequency
rename water_bill3 water_bill
rename water_shutoff3 water_shutoff
rename hh1_income3 hh1_income
rename hh2_income3 hh2_income
rename hh3_income3 hh3_income
rename hh4_income3 hh4_income
rename hh5_income3 hh5_income
rename hh6_income3 hh6_income
rename hh7_income3 hh7_income
rename hh8_income3 hh8_income
rename income3 income
rename sought_govagency3 sought_govagency
rename sought_bank3 sought_bank
rename sought_payday3 sought_payday
rename sought_utility3 sought_utility
rename sought_nonprofit3 sought_nonprofit
rename sought_faithbased3 sought_faithbased
rename sought_family_friends3 sought_family_friends
rename form_call3 form_call
rename form_letter3 form_letter 
rename form_doorknock3 form_doorknock 
rename form_email3 form_email 
rename form_text3 form_text
rename response_contactutility3 response_contactutility
rename response_paymentplan3 response_paymentplan
rename response_legalservices3 response_legalservices
rename response_assistance3 response_assistance
rename response_internet3 response_internet
rename response_homechanges3 response_homechanges
rename response_reduceenergy3 response_reduceenergy
rename response_moved3 response_moved
rename reconnection_cost3 reconnection_cost
rename response_moved_temp3 response_moved_temp
rename response_moved_perm3 response_moved_perm
rename response_livedwithout3 response_livedwithout
rename response_otherhelp3 response_otherhelp
rename response_paidoff3 response_paidoff
rename response_usedothers3 response_usedothers
rename response_carorbattery3 response_carorbattery
rename no_ac3 no_ac
rename no_ac_reason3 no_ac_reason

save december_energy_insecurity.dta, replace

clear



******january Data******
use COMBINED_waves_1234.dta, replace
keep weight3 weight4 caseid_National caseid_Indiana caseid_w1 inputzip3 marstat state utility_type muni iou coop electricity3 gas3 wood3 propane3 fueloil3 age hhsize3 hh_under53 any_under53 any_over653 hh_over653 covid_lostwork3 covid_insurance3 covid_lessinsurance3 no_insurance3 any_disability3 home_trailer3 home_apartmentcondo3 home_singlefam3 home_other3 utilitybill_pay_irregular3 utilitydebt_over1003 genhealth_goodtogreat3 hh_disability3 educ3 educ_HS3 homeowner3 ownhome3 retired race white black hispanic native_american female hhinc3 fpl3 under_100_fpl3 FPL_100_1503 FPL_150_2003 dwelling_type1 dwelling_type2 dwelling_type3 poor_insulation1 drafty1 mold1 holes1 plumbing1 exposed_sockets1 nonworking_stove_fridge1 broken_ac1 poor_insulation2 drafty2 mold2 holes2 plumbing2 exposed_sockets2 nonworking_stove_fridge2 broken_ac2 poor_insulation3 drafty3 mold3 holes3 plumbing3 exposed_sockets3 nonworking_stove_fridge3 broken_ac3 trust_energyco3 dwelling_condition1 dwelling_condition2 dwelling_condition3 fuel_payment3 hhbill_january notice_january disconnect_january electronic_device3 energybill_change3 stimulus_january energy_assistance_january gov_agency_january energy_provider_january friend_family_january faith_org_january nonprofit_january payday_lender_january bankloan_january gov_assistance_january forego_expenses_january wap_january liheap_january snap_january tanf_january ssi_january medicaid_january vet_benefits_january unemp_insurance_january gov_assistance_january stove_5mos spaceheater_5mos woodstove_5mos fireplace_5mos hotshower_5mos burntrash_5mos heavycoat_5mos boughtice_5mos coldshowers_5mos dryer_5mos centralac_5mos windowac_5mos fan_5mos dehumidifier_5mos lefthouse_5mos openedwindows_5mos covid_employment3 covid_rent3 covid_feedfamily3 covid_medicalcare3 covid_lostinsurance3 date_unemployed3 employed3 unemployed3 employ3 efficient_appliances3 efficient_insulation3 efficient_ac3 efficient_smartmeter3 efficient_lights3 efficient_hometemp3 efficient_devices3 efficient_hungwindow3 utilitypay_check3 utilitypay_credit3 utilitypay_debit3 utilitypay_withdrawal3 utilitypay_cash3 utilitybill_pay3 utilityhelp_friend3 utilityhelp_paydayloan3 utilityhelp_credit3 utilityhelp_notice3 utility_debt3 debt_over10003 behind_rent3 behind_credit3 behind_car3 behind_medical3 behind_bankloan3 behind_personalloan3 behind_studentloan3 evictnotice_january evicted_january legal_help3 legal_access3 legal_source3 generalhealth_rate3 prescription3 fill_prescription3 mentalhealth_days3 highbloodpressure3 heartdisease3 diabetes3 cancer3 obesity3 asthma3 skipped_meals3 skipped_meals_frequency3 water_bill3 water_shutoff3 hh1_income3 hh2_income3 hh3_income3 hh4_income3 hh5_income3 hh6_income3 hh7_income3 hh8_income3 income3 dwelling_open3 maintainbills_open3 debt_over1000_open3 chronic_conditions_open3 covid_employmentchange_open3 utilitybillpay_open3 utilitybillhelp_open3 utilitypaymethod_open3 staycool_open3 staywarm_open3 govassist_open3 energyassist_open3 response_notice_open3 energyefficiency_open3 sought_govagency3 sought_bank3 sought_payday3 sought_utility3 sought_nonprofit3 sought_faithbased3 sought_family_friends3 form_call3 form_letter3 form_doorknock3 form_email3 form_text3  response_contactutility3 response_paymentplan3 response_legalservices3 response_assistance3 response_internet3 response_homechanges3 response_reduceenergy3 response_moved3 reconnection_cost3 response_moved_temp3 response_moved_perm3 response_livedwithout3 response_otherhelp3 response_paidoff3 response_usedothers3 response_carorbattery3 no_ac3 no_ac_reason3


drop if hhbill_january==.

gen month=9
gen wave=3

rename weight3 weight
rename weight4 weight_balanced
rename inputzip3 zip
rename electricity3 electricity
rename gas3 gas
rename wood3 wood
rename propane3 propane
rename fueloil3 fueloil
rename hhsize3 hhsize
rename hh_under53 hh_under5
rename hh_over653 hh_over65
rename any_under53 any_under5
rename any_over653 any_over65
rename covid_lostwork3 covid_lostwork
rename covid_insurance3 covid_insurance
rename covid_lessinsurance3 covid_lessinsurance
rename no_insurance3 no_insurance
rename any_disability3 any_disability
rename home_trailer3 home_trailer
rename home_apartmentcondo3 home_apartmentcondo
rename home_singlefam3 home_singlefam
rename home_other3 home_other
rename utilitybill_pay_irregular3 utilitybill_pay_irregular
rename utilitydebt_over1003 utility_debt_over100
rename genhealth_goodtogreat3 genhealth_goodtogreat
rename hh_disability3 hh_disability
rename educ3 educ
rename educ_HS3 educ_HS
rename homeowner3 homeowner
rename ownhome3 ownhome
rename hhinc3 hhinc
rename fpl3 fpl
rename under_100_fpl3 under_100_fpl
rename FPL_100_1503 FPL_100_150
rename FPL_150_2003 FPL_150_200
rename dwelling_type1 dwelling_type
gen poor_insulation=0
replace poor_insulation=1 if poor_insulation1==1 | poor_insulation2==1 | poor_insulation3==1
gen drafty=0
replace drafty=1 if drafty1==1 | drafty2==1 | drafty3==1
gen mold=0
replace mold=1 if mold1==1 | mold2==1 | mold3==1
gen holes=0
replace holes=1 if holes1==1 | holes2==1 | holes3==1
gen plumbing=0
replace plumbing=1 if plumbing1==1 | plumbing2==1 | plumbing3==1
gen exposed_sockets=0
replace exposed_sockets=1 if exposed_sockets1==1 | exposed_sockets2==1 | exposed_sockets3==1
gen nonworking_stove_fridge=0
replace nonworking_stove_fridge=1 if nonworking_stove_fridge1==1 | nonworking_stove_fridge2==1 | nonworking_stove_fridge3==1
gen broken_ac=0
replace broken_ac=1 if broken_ac1==1 | broken_ac2==1 | broken_ac3==1
rename trust_energyco3 trust_energyco
gen dwelling_condition=0
replace dwelling_condition=1 if dwelling_condition1==1 | dwelling_condition2==1 | dwelling_condition3==1
rename fuel_payment3 fuel_payment
rename hhbill_january hhbill
rename notice_january notice
rename disconnect_january disconnect
rename electronic_device3 electronic_device
rename energybill_change3 energybill_change
rename stimulus_january stimulus
rename energy_assistance_january energy_assistance
rename gov_agency_january gov_agency
rename energy_provider_january energy_provider
rename friend_family_january friend_family
rename faith_org_january faith_org
rename nonprofit_january nonprofit
rename payday_lender_january payday_lender
rename bankloan_january bankloan
rename gov_assistance_january gov_assistance
rename forego_expenses_january forego_expenses
rename wap_january wap
rename liheap_january liheap
rename snap_january snap
rename tanf_january tanf
rename ssi_january ssi
rename medicaid_january medicaid
rename vet_benefits_january vet_benefits
rename unemp_insurance_january unemp_insurance
rename stove_5mos stove
rename spaceheater_5mos spaceheater
rename woodstove_5mos woodstove
rename fireplace_5mos fireplace
rename hotshower_5mos hotshower
rename burntrash_5mos burntrash
rename heavycoat_5mos heavycoat
rename boughtice_5mos boughtice
rename coldshowers_5mos coldshower
rename dryer_5mos dryer
rename centralac_5mos centralac
rename windowac_5mos windowac
rename fan_5mos fan
rename dehumidifier_5mos dehumidifier
rename lefthouse_5mos lefthouse
rename openedwindows_5mos openedwindows
rename covid_employment3 covid_employment
rename covid_rent3 covid_rent
rename covid_feedfamily3 covid_feedfamily
rename covid_medicalcare3 covid_medicalcare
rename covid_lostinsurance3 covid_lostinsurance
rename date_unemployed3 date_unemployed
rename employed3 employed
rename unemployed3 unemployed
rename employ3 employ
rename efficient_appliances3 efficient_appliances
rename efficient_insulation3 efficient_insulation
rename efficient_ac3 efficient_ac
rename efficient_smartmeter3 efficient_smartmeter
rename efficient_lights3 efficient_lights
rename efficient_hometemp3 efficient_hometemp
rename efficient_devices3 efficient_devices
rename efficient_hungwindow3 efficient_hungwindow
rename utilitypay_check3 utilitypay_check
rename utilitypay_credit3 utilitypay_credit
rename utilitypay_debit3 utilitypay_debite
rename utilitypay_withdrawal3 utilitypay_withdrawal
rename utilitypay_cash3 utilitypay_cash
rename utilitybill_pay3 utilitybill_pay
rename utilityhelp_friend3 utilityhelp_friend
rename utilityhelp_paydayloan3 utilityhelp_paydayloan
rename utilityhelp_credit3 utilityhelp_credit
rename utilityhelp_notice3 utilityhelp_notice
rename utility_debt3 utility_debt
rename debt_over10003 debt_over1000
rename behind_rent3 behind_rent
rename behind_credit3 behind_credit
rename behind_car3 behind_car
rename behind_medical3 behind_medical
rename behind_bankloan3 behind_bankloan
rename behind_personalloan3 behind_personalloan
rename behind_studentloan3 behind_studentloan
rename evictnotice_january evict_notice
rename evicted_january evicted
rename legal_help3 legal_help
rename legal_access3 legal_access
rename legal_source3 legal_source
rename generalhealth_rate3 generalhealth_rate
rename prescription3 prescription
rename fill_prescription3 fill_prescription
rename mentalhealth_days3 mentalhealth_days
rename highbloodpressure3 highbloodpressure
rename heartdisease3 heartdisease
rename diabetes3 diabetes
rename cancer3 cancer
rename obesity3 obesity
rename asthma3 asthma
rename skipped_meals3 skipped_meals
rename skipped_meals_frequency3 skipped_meals_frequency
rename water_bill3 water_bill
rename water_shutoff3 water_shutoff
rename hh1_income3 hh1_income
rename hh2_income3 hh2_income
rename hh3_income3 hh3_income
rename hh4_income3 hh4_income
rename hh5_income3 hh5_income
rename hh6_income3 hh6_income
rename hh7_income3 hh7_income
rename hh8_income3 hh8_income
rename income3 income
rename sought_govagency3 sought_govagency
rename sought_bank3 sought_bank
rename sought_payday3 sought_payday
rename sought_utility3 sought_utility
rename sought_nonprofit3 sought_nonprofit
rename sought_faithbased3 sought_faithbased
rename sought_family_friends3 sought_family_friends
rename form_call3 form_call
rename form_letter3 form_letter 
rename form_doorknock3 form_doorknock 
rename form_email3 form_email 
rename form_text3 form_text
rename response_contactutility3 response_contactutility
rename response_paymentplan3 response_paymentplan
rename response_legalservices3 response_legalservices
rename response_assistance3 response_assistance
rename response_internet3 response_internet
rename response_homechanges3 response_homechanges
rename response_reduceenergy3 response_reduceenergy
rename response_moved3 response_moved
rename reconnection_cost3 reconnection_cost
rename response_moved_temp3 response_moved_temp
rename response_moved_perm3 response_moved_perm
rename response_livedwithout3 response_livedwithout
rename response_otherhelp3 response_otherhelp
rename response_paidoff3 response_paidoff
rename response_usedothers3 response_usedothers
rename response_carorbattery3 response_carorbattery
rename no_ac3 no_ac
rename no_ac_reason3 no_ac_reason

save january_energy_insecurity.dta, replace

clear


******february Data******
use COMBINED_waves_1234.dta, replace
keep weight4 caseid_National caseid_Indiana caseid_w1 inputzip4 marstat state utility_type muni iou coop electricity4 gas4 wood4 propane4 fueloil4 age hhsize4 hh_under54 any_under54 any_over654 hh_over654 covid_lostwork4 covid_insurance4 covid_lessinsurance4 no_insurance4 any_disability4 home_trailer4 home_apartmentcondo4 home_singlefam4 home_other4 utilitybill_pay_irregular4 utilitydebt_over1004 genhealth_goodtogreat4 hh_disability4 educ4 educ_HS4 homeowner4 ownhome4 retired race white black hispanic native_american female hhinc4 fpl4 under_100_fpl4 FPL_100_1504 FPL_150_2004 dwelling_type1 dwelling_type2 dwelling_type3 dwelling_type4 poor_insulation1 drafty1 mold1 holes1 plumbing1 exposed_sockets1 nonworking_stove_fridge1 broken_ac1 poor_insulation2 drafty2 mold2 holes2 plumbing2 exposed_sockets2 nonworking_stove_fridge2 broken_ac2 poor_insulation3 drafty3 mold3 holes3 plumbing3 exposed_sockets3 nonworking_stove_fridge3 broken_ac3 poor_insulation4 drafty4 mold4 holes4 plumbing4 exposed_sockets4 nonworking_stove_fridge4 broken_ac4 trust_energyco4 dwelling_condition1 dwelling_condition2 dwelling_condition3 dwelling_condition4 fuel_payment4 hhbill_february notice_february disconnect_february electronic_device4 energybill_change4 stimulus_february energy_assistance_february gov_agency_february energy_provider_february friend_family_february faith_org_february nonprofit_february payday_lender_february bankloan_february gov_assistance_february forego_expenses_february wap_february liheap_february snap_february tanf_february ssi_february medicaid_february vet_benefits_february unemp_insurance_february gov_assistance_february stove_4mos spaceheater_4mos woodstove_4mos fireplace_4mos hotshower_4mos burntrash_4mos heavycoat_4mos boughtice_4mos coldshowers_4mos dryer_4mos centralac_4mos windowac_4mos fan_4mos dehumidifier_4mos lefthouse_4mos openedwindows_4mos covid_employment4 covid_rent4 covid_feedfamily4 covid_medicalcare4 covid_lostinsurance4 date_unemployed4 employed4 unemployed4 employ4 efficient_appliances4 efficient_insulation4 efficient_ac4 efficient_smartmeter4 efficient_lights4 efficient_hometemp4 efficient_devices4 efficient_hungwindow4 utilitypay_check4 utilitypay_credit4 utilitypay_debit4 utilitypay_withdrawal4 utilitypay_cash4 utilitybill_pay4 utilityhelp_friend4 utilityhelp_paydayloan4 utilityhelp_credit4 utilityhelp_notice4 utility_debt4 debt_over10004 behind_rent4 behind_credit4 behind_car4 behind_medical4 behind_bankloan4 behind_personalloan4 behind_studentloan4 evictnotice_february evicted_february legal_help4 legal_access4 legal_source4 generalhealth_rate4 prescription4 fill_prescription4 mentalhealth_days4 highbloodpressure4 heartdisease4 diabetes4 cancer4 obesity4 asthma4 skipped_meals4 skipped_meals_frequency4 water_bill4 water_shutoff4 hh1_income4 hh2_income4 hh3_income4 hh4_income4 hh5_income4 hh6_income4 hh7_income4 hh8_income4 income4 dwelling_open4 employmentstatus_open4 maintainbills_open4 debt_over1000_open4 chronic_conditions_open4 covid_employmentchange_open4 utilitybillpay_open4 utilitybillhelp_open4 utilitypaymethod_open4 staycool_open4 staywarm_open4 govassist_open4 energyassist_open4 response_notice_open4 energyefficiency_open4 sought_govagency4 sought_bank4 sought_payday4 sought_utility4 sought_nonprofit4 sought_faithbased4 sought_family_friends4 form_call4 form_letter4 form_doorknock4 form_email4 form_text4 response_contactutility4 response_paymentplan4 response_legalservices4 response_assistance4 response_internet4 response_homechanges4 response_reduceenergy4 response_moved4 reconnection_cost4 response_moved_temp4 response_moved_perm4 response_livedwithout4 response_otherhelp4 response_paidoff4 response_usedothers4 response_carorbattery4 no_ac4 no_ac_reason4


drop if hhbill_february==.

gen month=10
gen wave=4

rename weight4 weight
clonevar weight_balanced = weight
rename inputzip4 zip
rename electricity4 electricity
rename gas4 gas
rename wood4 wood
rename propane4 propane
rename fueloil4 fueloil
rename hhsize4 hhsize
rename hh_under54 hh_under5
rename hh_over654 hh_over65
rename any_under54 any_under5
rename any_over654 any_over65
rename covid_lostwork4 covid_lostwork
rename covid_insurance4 covid_insurance
rename covid_lessinsurance4 covid_lessinsurance
rename no_insurance4 no_insurance
rename any_disability4 any_disability
rename home_trailer4 home_trailer
rename home_apartmentcondo4 home_apartmentcondo
rename home_singlefam4 home_singlefam
rename home_other4 home_other
rename utilitybill_pay_irregular4 utilitybill_pay_irregular
rename utilitydebt_over1004 utility_debt_over100
rename genhealth_goodtogreat4 genhealth_goodtogreat
rename hh_disability4 hh_disability
rename educ4 educ
rename educ_HS4 educ_HS
rename homeowner4 homeowner
rename ownhome4 ownhome
rename hhinc4 hhinc
rename fpl4 fpl
rename under_100_fpl4 under_100_fpl
rename FPL_100_1504 FPL_100_150
rename FPL_150_2004 FPL_150_200
rename dwelling_type1 dwelling_type
gen poor_insulation=0
replace poor_insulation=1 if poor_insulation1==1 | poor_insulation2==1 | poor_insulation3==1 | poor_insulation4==1
gen drafty=0
replace drafty=1 if drafty1==1 | drafty2==1 | drafty3==1 | drafty4==1
gen mold=0
replace mold=1 if mold1==1 | mold2==1 | mold3==1 | mold4==1
gen holes=0
replace holes=1 if holes1==1 | holes2==1 | holes3==1 | holes4==1
gen plumbing=0
replace plumbing=1 if plumbing1==1 | plumbing2==1 | plumbing3==1 | plumbing4 ==1
gen exposed_sockets=0
replace exposed_sockets=1 if exposed_sockets1==1 | exposed_sockets2==1 | exposed_sockets3==1 |exposed_sockets4 ==1
gen nonworking_stove_fridge=0
replace nonworking_stove_fridge=1 if nonworking_stove_fridge1==1 | nonworking_stove_fridge2==1 | nonworking_stove_fridge3==1 | nonworking_stove_fridge4==1
gen broken_ac=0
replace broken_ac=1 if broken_ac1==1 | broken_ac2==1 | broken_ac3==1 | broken_ac4==1
rename trust_energyco4 trust_energyco
gen dwelling_condition=0
replace dwelling_condition=1 if dwelling_condition1==1 | dwelling_condition2==1 | dwelling_condition3==1 | dwelling_condition4
rename fuel_payment4 fuel_payment
rename hhbill_february hhbill
rename notice_february notice
rename disconnect_february disconnect
rename electronic_device4 electronic_device
rename energybill_change4 energybill_change
rename stimulus_february stimulus
rename energy_assistance_february energy_assistance
rename gov_agency_february gov_agency
rename energy_provider_february energy_provider
rename friend_family_february friend_family
rename faith_org_february faith_org
rename nonprofit_february nonprofit
rename payday_lender_february payday_lender
rename bankloan_february bankloan
rename gov_assistance_february gov_assistance
rename forego_expenses_february forego_expenses
rename wap_february wap
rename liheap_february liheap
rename snap_february snap
rename tanf_february tanf
rename ssi_february ssi
rename medicaid_february medicaid
rename vet_benefits_february vet_benefits
rename unemp_insurance_february unemp_insurance
rename stove_4mos stove
rename spaceheater_4mos spaceheater
rename woodstove_4mos woodstove
rename fireplace_4mos fireplace
rename hotshower_4mos hotshower
rename burntrash_4mos burntrash
rename heavycoat_4mos heavycoat
rename boughtice_4mos boughtice
rename coldshowers_4mos coldshower
rename dryer_4mos dryer
rename centralac_4mos centralac
rename windowac_4mos windowac
rename fan_4mos fan
rename dehumidifier_4mos dehumidifier
rename lefthouse_4mos lefthouse
rename openedwindows_4mos openedwindows
rename covid_employment4 covid_employment
rename covid_rent4 covid_rent
rename covid_feedfamily4 covid_feedfamily
rename covid_medicalcare4 covid_medicalcare
rename covid_lostinsurance4 covid_lostinsurance
rename date_unemployed4 date_unemployed
rename employed4 employed
rename unemployed4 unemployed
rename employ4 employ
rename efficient_appliances4 efficient_appliances
rename efficient_insulation4 efficient_insulation
rename efficient_ac4 efficient_ac
rename efficient_smartmeter4 efficient_smartmeter
rename efficient_lights4 efficient_lights
rename efficient_hometemp4 efficient_hometemp
rename efficient_devices4 efficient_devices
rename efficient_hungwindow4 efficient_hungwindow
rename utilitypay_check4 utilitypay_check
rename utilitypay_credit4 utilitypay_credit
rename utilitypay_debit4 utilitypay_debite
rename utilitypay_withdrawal4 utilitypay_withdrawal
rename utilitypay_cash4 utilitypay_cash
rename utilitybill_pay4 utilitybill_pay
rename utilityhelp_friend4 utilityhelp_friend
rename utilityhelp_paydayloan4 utilityhelp_paydayloan
rename utilityhelp_credit4 utilityhelp_credit
rename utilityhelp_notice4 utilityhelp_notice
rename utility_debt4 utility_debt
rename debt_over10004 debt_over1000
rename behind_rent4 behind_rent
rename behind_credit4 behind_credit
rename behind_car4 behind_car
rename behind_medical4 behind_medical
rename behind_bankloan4 behind_bankloan
rename behind_personalloan4 behind_personalloan
rename behind_studentloan4 behind_studentloan
rename evictnotice_february evict_notice
rename evicted_february evicted
rename legal_help4 legal_help
rename legal_access4 legal_access
rename legal_source4 legal_source
rename generalhealth_rate4 generalhealth_rate
rename prescription4 prescription
rename fill_prescription4 fill_prescription
rename mentalhealth_days4 mentalhealth_days
rename highbloodpressure4 highbloodpressure
rename heartdisease4 heartdisease
rename diabetes4 diabetes
rename cancer4 cancer
rename obesity4 obesity
rename asthma4 asthma
rename skipped_meals4 skipped_meals
rename skipped_meals_frequency4 skipped_meals_frequency
rename water_bill4 water_bill
rename water_shutoff4 water_shutoff
rename hh1_income4 hh1_income
rename hh2_income4 hh2_income
rename hh3_income4 hh3_income
rename hh4_income4 hh4_income
rename hh5_income4 hh5_income
rename hh6_income4 hh6_income
rename hh7_income4 hh7_income
rename hh8_income4 hh8_income
rename income4 income
rename sought_govagency4 sought_govagency
rename sought_bank4 sought_bank
rename sought_payday4 sought_payday
rename sought_utility4 sought_utility
rename sought_nonprofit4 sought_nonprofit
rename sought_faithbased4 sought_faithbased
rename sought_family_friends4 sought_family_friends
rename form_call4 form_call
rename form_letter4 form_letter 
rename form_doorknock4 form_doorknock 
rename form_email4 form_email 
rename form_text4 form_text
rename response_contactutility4 response_contactutility
rename response_paymentplan4 response_paymentplan
rename response_legalservices4 response_legalservices
rename response_assistance4 response_assistance
rename response_internet4 response_internet
rename response_homechanges4 response_homechanges
rename response_reduceenergy4 response_reduceenergy
rename response_moved4 response_moved
rename reconnection_cost4 reconnection_cost
rename response_moved_temp4 response_moved_temp
rename response_moved_perm4 response_moved_perm
rename response_livedwithout4 response_livedwithout
rename response_otherhelp4 response_otherhelp
rename response_paidoff4 response_paidoff
rename response_usedothers4 response_usedothers
rename response_carorbattery4 response_carorbattery
rename no_ac4 no_ac
rename no_ac_reason4 no_ac_reason

save february_energy_insecurity.dta, replace

clear


******march Data******
use COMBINED_waves_1234.dta, replace
keep weight4 caseid_National caseid_Indiana caseid_w1 inputzip4 marstat state utility_type muni iou coop electricity4 gas4 wood4 propane4 fueloil4 age hhsize4 hh_under54 any_under54 any_over654 hh_over654 covid_lostwork4 covid_insurance4 covid_lessinsurance4 no_insurance4 any_disability4 home_trailer4 home_apartmentcondo4 home_singlefam4 home_other4 utilitybill_pay_irregular4 utilitydebt_over1004 genhealth_goodtogreat4 hh_disability4 educ4 educ_HS4 homeowner4 ownhome4 retired race white black hispanic native_american female hhinc4 fpl4 under_100_fpl4 FPL_100_1504 FPL_150_2004 dwelling_type1 dwelling_type2 dwelling_type3 dwelling_type4 poor_insulation1 drafty1 mold1 holes1 plumbing1 exposed_sockets1 nonworking_stove_fridge1 broken_ac1 poor_insulation2 drafty2 mold2 holes2 plumbing2 exposed_sockets2 nonworking_stove_fridge2 broken_ac2 poor_insulation3 drafty3 mold3 holes3 plumbing3 exposed_sockets3 nonworking_stove_fridge3 broken_ac3 poor_insulation4 drafty4 mold4 holes4 plumbing4 exposed_sockets4 nonworking_stove_fridge4 broken_ac4 trust_energyco4 dwelling_condition1 dwelling_condition2 dwelling_condition3 dwelling_condition4 fuel_payment4 hhbill_march notice_march disconnect_march electronic_device4 energybill_change4 stimulus_march energy_assistance_march gov_agency_march energy_provider_march friend_family_march faith_org_march nonprofit_march payday_lender_march bankloan_march gov_assistance_march forego_expenses_march wap_march liheap_march snap_march tanf_march ssi_march medicaid_march vet_benefits_march unemp_insurance_march gov_assistance_march stove_4mos spaceheater_4mos woodstove_4mos fireplace_4mos hotshower_4mos burntrash_4mos heavycoat_4mos boughtice_4mos coldshowers_4mos dryer_4mos centralac_4mos windowac_4mos fan_4mos dehumidifier_4mos lefthouse_4mos openedwindows_4mos covid_employment4 covid_rent4 covid_feedfamily4 covid_medicalcare4 covid_lostinsurance4 date_unemployed4 employed4 unemployed4 employ4 efficient_appliances4 efficient_insulation4 efficient_ac4 efficient_smartmeter4 efficient_lights4 efficient_hometemp4 efficient_devices4 efficient_hungwindow4 utilitypay_check4 utilitypay_credit4 utilitypay_debit4 utilitypay_withdrawal4 utilitypay_cash4 utilitybill_pay4 utilityhelp_friend4 utilityhelp_paydayloan4 utilityhelp_credit4 utilityhelp_notice4 utility_debt4 debt_over10004 behind_rent4 behind_credit4 behind_car4 behind_medical4 behind_bankloan4 behind_personalloan4 behind_studentloan4 evictnotice_march evicted_march legal_help4 legal_access4 legal_source4 generalhealth_rate4 prescription4 fill_prescription4 mentalhealth_days4 highbloodpressure4 heartdisease4 diabetes4 cancer4 obesity4 asthma4 skipped_meals4 skipped_meals_frequency4 water_bill4 water_shutoff4 hh1_income4 hh2_income4 hh3_income4 hh4_income4 hh5_income4 hh6_income4 hh7_income4 hh8_income4 income4 dwelling_open4 employmentstatus_open4 maintainbills_open4 debt_over1000_open4 chronic_conditions_open4 covid_employmentchange_open4 utilitybillpay_open4 utilitybillhelp_open4 utilitypaymethod_open4 staycool_open4 staywarm_open4 govassist_open4 energyassist_open4 response_notice_open4 energyefficiency_open4 sought_govagency4 sought_bank4 sought_payday4 sought_utility4 sought_nonprofit4 sought_faithbased4 sought_family_friends4 form_call4 form_letter4 form_doorknock4 form_email4 form_text4 response_contactutility4 response_paymentplan4 response_legalservices4 response_assistance4 response_internet4 response_homechanges4 response_reduceenergy4 response_moved4 reconnection_cost4 response_moved_temp4 response_moved_perm4 response_livedwithout4 response_otherhelp4 response_paidoff4 response_usedothers4 response_carorbattery4 no_ac4 no_ac_reason4

drop if hhbill_march==.


gen month=11
gen wave=4

rename weight4 weight
clonevar weight_balanced = weight
rename inputzip4 zip
rename electricity4 electricity
rename gas4 gas
rename wood4 wood
rename propane4 propane
rename fueloil4 fuel
rename hhsize4 hhsize
rename hh_under54 hh_under5
rename hh_over654 hh_over65
rename any_under54 any_under5
rename any_over654 any_over65
rename covid_lostwork4 covid_lostwork
rename covid_insurance4 covid_insurance
rename covid_lessinsurance4 covid_lessinsurance
rename no_insurance4 no_insurance
rename any_disability4 any_disability
rename home_trailer4 home_trailer
rename home_apartmentcondo4 home_apartmentcondo
rename home_singlefam4 home_singlefam
rename home_other4 home_other
rename utilitybill_pay_irregular4 utilitybill_pay_irregular
rename utilitydebt_over1004 utility_debt_over100
rename genhealth_goodtogreat4 genhealth_goodtogreat
rename hh_disability4 hh_disability
rename educ4 educ
rename educ_HS4 educ_HS
rename homeowner4 homeowner
rename ownhome4 ownhome
rename hhinc4 hhinc
rename fpl4 fpl
rename under_100_fpl4 under_100_fpl
rename FPL_100_1504 FPL_100_150
rename FPL_150_2004 FPL_150_200
rename dwelling_type1 dwelling_type
gen poor_insulation=0
replace poor_insulation=1 if poor_insulation1==1 | poor_insulation2==1 | poor_insulation3==1 | poor_insulation4==1
gen drafty=0
replace drafty=1 if drafty1==1 | drafty2==1 | drafty3==1 | drafty4==1
gen mold=0
replace mold=1 if mold1==1 | mold2==1 | mold3==1 | mold4==1
gen holes=0
replace holes=1 if holes1==1 | holes2==1 | holes3==1 | holes4==1
gen plumbing=0
replace plumbing=1 if plumbing1==1 | plumbing2==1 | plumbing3==1 | plumbing4 ==1
gen exposed_sockets=0
replace exposed_sockets=1 if exposed_sockets1==1 | exposed_sockets2==1 | exposed_sockets3==1 |exposed_sockets4 ==1
gen nonworking_stove_fridge=0
replace nonworking_stove_fridge=1 if nonworking_stove_fridge1==1 | nonworking_stove_fridge2==1 | nonworking_stove_fridge3==1 | nonworking_stove_fridge4==1
gen broken_ac=0
replace broken_ac=1 if broken_ac1==1 | broken_ac2==1 | broken_ac3==1 | broken_ac4==1
rename trust_energyco4 trust_energyco
gen dwelling_condition=0
replace dwelling_condition=1 if dwelling_condition1==1 | dwelling_condition2==1 | dwelling_condition3==1 | dwelling_condition4
rename fuel_payment4 fuel_payment
rename hhbill_march hhbill
rename notice_march notice
rename disconnect_march disconnect
rename electronic_device4 electronic_device
rename energybill_change4 energybill_change
rename stimulus_march stimulus
rename energy_assistance_march energy_assistance
rename gov_agency_march gov_agency
rename energy_provider_march energy_provider
rename friend_family_march friend_family
rename faith_org_march faith_org
rename nonprofit_march nonprofit
rename payday_lender_march payday_lender
rename bankloan_march bankloan
rename gov_assistance_march gov_assistance
rename forego_expenses_march forego_expenses
rename wap_march wap
rename liheap_march liheap
rename snap_march snap
rename tanf_march tanf
rename ssi_march ssi
rename medicaid_march medicaid
rename vet_benefits_march vet_benefits
rename unemp_insurance_march unemp_insurance
rename stove_4mos stove
rename spaceheater_4mos spaceheater
rename woodstove_4mos woodstove
rename fireplace_4mos fireplace
rename hotshower_4mos hotshower
rename burntrash_4mos burntrash
rename heavycoat_4mos heavycoat
rename boughtice_4mos boughtice
rename coldshowers_4mos coldshower
rename dryer_4mos dryer
rename centralac_4mos centralac
rename windowac_4mos windowac
rename fan_4mos fan
rename dehumidifier_4mos dehumidifier
rename lefthouse_4mos lefthouse
rename openedwindows_4mos openedwindows
rename covid_employment4 covid_employment
rename covid_rent4 covid_rent
rename covid_feedfamily4 covid_feedfamily
rename covid_medicalcare4 covid_medicalcare
rename covid_lostinsurance4 covid_lostinsurance
rename date_unemployed4 date_unemployed
rename employed4 employed
rename unemployed4 unemployed
rename employ4 employ
rename efficient_appliances4 efficient_appliances
rename efficient_insulation4 efficient_insulation
rename efficient_ac4 efficient_ac
rename efficient_smartmeter4 efficient_smartmeter
rename efficient_lights4 efficient_lights
rename efficient_hometemp4 efficient_hometemp
rename efficient_devices4 efficient_devices
rename efficient_hungwindow4 efficient_hungwindow
rename utilitypay_check4 utilitypay_check
rename utilitypay_credit4 utilitypay_credit
rename utilitypay_debit4 utilitypay_debite
rename utilitypay_withdrawal4 utilitypay_withdrawal
rename utilitypay_cash4 utilitypay_cash
rename utilitybill_pay4 utilitybill_pay
rename utilityhelp_friend4 utilityhelp_friend
rename utilityhelp_paydayloan4 utilityhelp_paydayloan
rename utilityhelp_credit4 utilityhelp_credit
rename utilityhelp_notice4 utilityhelp_notice
rename utility_debt4 utility_debt
rename debt_over10004 debt_over1000
rename behind_rent4 behind_rent
rename behind_credit4 behind_credit
rename behind_car4 behind_car
rename behind_medical4 behind_medical
rename behind_bankloan4 behind_bankloan
rename behind_personalloan4 behind_personalloan
rename behind_studentloan4 behind_studentloan
rename evictnotice_march evict_notice
rename evicted_march evicted
rename legal_help4 legal_help
rename legal_access4 legal_access
rename legal_source4 legal_source
rename generalhealth_rate4 generalhealth_rate
rename prescription4 prescription
rename fill_prescription4 fill_prescription
rename mentalhealth_days4 mentalhealth_days
rename highbloodpressure4 highbloodpressure
rename heartdisease4 heartdisease
rename diabetes4 diabetes
rename cancer4 cancer
rename obesity4 obesity
rename asthma4 asthma
rename skipped_meals4 skipped_meals
rename skipped_meals_frequency4 skipped_meals_frequency
rename water_bill4 water_bill
rename water_shutoff4 water_shutoff
rename hh1_income4 hh1_income
rename hh2_income4 hh2_income
rename hh3_income4 hh3_income
rename hh4_income4 hh4_income
rename hh5_income4 hh5_income
rename hh6_income4 hh6_income
rename hh7_income4 hh7_income
rename hh8_income4 hh8_income
rename income4 income
rename sought_govagency4 sought_govagency
rename sought_bank4 sought_bank
rename sought_payday4 sought_payday
rename sought_utility4 sought_utility
rename sought_nonprofit4 sought_nonprofit
rename sought_faithbased4 sought_faithbased
rename sought_family_friends4 sought_family_friends
rename form_call4 form_call
rename form_letter4 form_letter 
rename form_doorknock4 form_doorknock 
rename form_email4 form_email 
rename form_text4 form_text
rename response_contactutility4 response_contactutility
rename response_paymentplan4 response_paymentplan
rename response_legalservices4 response_legalservices
rename response_assistance4 response_assistance
rename response_internet4 response_internet
rename response_homechanges4 response_homechanges
rename response_reduceenergy4 response_reduceenergy
rename response_moved4 response_moved
rename reconnection_cost4 reconnection_cost
rename response_moved_temp4 response_moved_temp
rename response_moved_perm4 response_moved_perm
rename response_livedwithout4 response_livedwithout
rename response_otherhelp4 response_otherhelp
rename response_paidoff4 response_paidoff
rename response_usedothers4 response_usedothers
rename response_carorbattery4 response_carorbattery
rename no_ac4 no_ac
rename no_ac_reason4 no_ac_reason

save march_energy_insecurity.dta, replace

clear





******april Data******
use COMBINED_waves_1234.dta, replace
keep weight4 caseid_National caseid_Indiana caseid_w1 inputzip4 marstat state utility_type muni iou coop electricity4 gas4 wood4 propane4 fueloil4 age hhsize4 hh_under54 any_under54 any_over654 hh_over654 covid_lostwork4 covid_insurance4 covid_lessinsurance4 no_insurance4 any_disability4 home_trailer4 home_apartmentcondo4 home_singlefam4 home_other4 utilitybill_pay_irregular4 utilitydebt_over1004 genhealth_goodtogreat4 hh_disability4 educ4 educ_HS4 homeowner4 ownhome4 retired race white black hispanic native_american female hhinc4 fpl4 under_100_fpl4 FPL_100_1504 FPL_150_2004 dwelling_type1 dwelling_type2 dwelling_type3 dwelling_type4 poor_insulation1 drafty1 mold1 holes1 plumbing1 exposed_sockets1 nonworking_stove_fridge1 broken_ac1 poor_insulation2 drafty2 mold2 holes2 plumbing2 exposed_sockets2 nonworking_stove_fridge2 broken_ac2 poor_insulation3 drafty3 mold3 holes3 plumbing3 exposed_sockets3 nonworking_stove_fridge3 broken_ac3 poor_insulation4 drafty4 mold4 holes4 plumbing4 exposed_sockets4 nonworking_stove_fridge4 broken_ac4 trust_energyco4 dwelling_condition1 dwelling_condition2 dwelling_condition3 dwelling_condition4 fuel_payment4 hhbill_april notice_april disconnect_april electronic_device4 energybill_change4 stimulus_april energy_assistance_april gov_agency_april energy_provider_april friend_family_april faith_org_april nonprofit_april payday_lender_april bankloan_april gov_assistance_april forego_expenses_april wap_april liheap_april snap_april tanf_april ssi_april medicaid_april vet_benefits_april unemp_insurance_april gov_assistance_april stove_4mos spaceheater_4mos woodstove_4mos fireplace_4mos hotshower_4mos burntrash_4mos heavycoat_4mos boughtice_4mos coldshowers_4mos dryer_4mos centralac_4mos windowac_4mos fan_4mos dehumidifier_4mos lefthouse_4mos openedwindows_4mos covid_employment4 covid_rent4 covid_feedfamily4 covid_medicalcare4 covid_lostinsurance4 date_unemployed4 employed4 unemployed4 employ4 efficient_appliances4 efficient_insulation4 efficient_ac4 efficient_smartmeter4 efficient_lights4 efficient_hometemp4 efficient_devices4 efficient_hungwindow4 utilitypay_check4 utilitypay_credit4 utilitypay_debit4 utilitypay_withdrawal4 utilitypay_cash4 utilitybill_pay4 utilityhelp_friend4 utilityhelp_paydayloan4 utilityhelp_credit4 utilityhelp_notice4 utility_debt4 debt_over10004 behind_rent4 behind_credit4 behind_car4 behind_medical4 behind_bankloan4 behind_personalloan4 behind_studentloan4 evictnotice_april evicted_april legal_help4 legal_access4 legal_source4 generalhealth_rate4 prescription4 fill_prescription4 mentalhealth_days4 highbloodpressure4 heartdisease4 diabetes4 cancer4 obesity4 asthma4 skipped_meals4 skipped_meals_frequency4 water_bill4 water_shutoff4 hh1_income4 hh2_income4 hh3_income4 hh4_income4 hh5_income4 hh6_income4 hh7_income4 hh8_income4 income4 dwelling_open4 employmentstatus_open4 maintainbills_open4 debt_over1000_open4 chronic_conditions_open4 covid_employmentchange_open4 utilitybillpay_open4 utilitybillhelp_open4 utilitypaymethod_open4 staycool_open4 staywarm_open4 govassist_open4 energyassist_open4 response_notice_open4 energyefficiency_open4 sought_govagency4 sought_bank4 sought_payday4 sought_utility4 sought_nonprofit4 sought_faithbased4 sought_family_friends4 form_call4 form_letter4 form_doorknock4 form_email4 form_text4 response_contactutility4 response_paymentplan4 response_legalservices4 response_assistance4 response_internet4 response_homechanges4 response_reduceenergy4 response_moved4 reconnection_cost4 response_moved_temp4 response_moved_perm4 response_livedwithout4 response_otherhelp4 response_paidoff4 response_usedothers4 response_carorbattery4 no_ac4 no_ac_reason4

drop if hhbill_april==.

gen month=12
gen wave=4

rename weight4 weight
clonevar weight_balanced = weight
rename inputzip4 zip
rename electricity4 electricity
rename gas4 gas
rename wood4 wood
rename propane4 propane
rename fueloil4 fueloil
rename hhsize4 hhsize
rename hh_under54 hh_under5
rename hh_over654 hh_over65
rename any_under54 any_under5
rename any_over654 any_over65
rename covid_lostwork4 covid_lostwork
rename covid_insurance4 covid_insurance
rename covid_lessinsurance4 covid_lessinsurance
rename no_insurance4 no_insurance
rename any_disability4 any_disability
rename home_trailer4 home_trailer
rename home_apartmentcondo4 home_apartmentcondo
rename home_singlefam4 home_singlefam
rename home_other4 home_other
rename utilitybill_pay_irregular4 utilitybill_pay_irregular
rename utilitydebt_over1004 utility_debt_over100
rename genhealth_goodtogreat4 genhealth_goodtogreat
rename hh_disability4 hh_disability
rename educ4 educ
rename educ_HS4 educ_HS
rename homeowner4 homeowner
rename ownhome4 ownhome
rename hhinc4 hhinc
rename fpl4 fpl
rename under_100_fpl4 under_100_fpl
rename FPL_100_1504 FPL_100_150
rename FPL_150_2004 FPL_150_200
rename dwelling_type1 dwelling_type
gen poor_insulation=0
replace poor_insulation=1 if poor_insulation1==1 | poor_insulation2==1 | poor_insulation3==1 | poor_insulation4==1
gen drafty=0
replace drafty=1 if drafty1==1 | drafty2==1 | drafty3==1 | drafty4==1
gen mold=0
replace mold=1 if mold1==1 | mold2==1 | mold3==1 | mold4==1
gen holes=0
replace holes=1 if holes1==1 | holes2==1 | holes3==1 | holes4==1
gen plumbing=0
replace plumbing=1 if plumbing1==1 | plumbing2==1 | plumbing3==1 | plumbing4 ==1
gen exposed_sockets=0
replace exposed_sockets=1 if exposed_sockets1==1 | exposed_sockets2==1 | exposed_sockets3==1 |exposed_sockets4 ==1
gen nonworking_stove_fridge=0
replace nonworking_stove_fridge=1 if nonworking_stove_fridge1==1 | nonworking_stove_fridge2==1 | nonworking_stove_fridge3==1 | nonworking_stove_fridge4==1
gen broken_ac=0
replace broken_ac=1 if broken_ac1==1 | broken_ac2==1 | broken_ac3==1 | broken_ac4==1
rename trust_energyco4 trust_energyco
gen dwelling_condition=0
replace dwelling_condition=1 if dwelling_condition1==1 | dwelling_condition2==1 | dwelling_condition3==1 | dwelling_condition4
rename fuel_payment4 fuel_payment
rename hhbill_april hhbill
rename notice_april notice
rename disconnect_april disconnect
rename electronic_device4 electronic_device
rename energybill_change4 energybill_change
rename stimulus_april stimulus
rename energy_assistance_april energy_assistance
rename gov_agency_april gov_agency
rename energy_provider_april energy_provider
rename friend_family_april friend_family
rename faith_org_april faith_org
rename nonprofit_april nonprofit
rename payday_lender_april payday_lender
rename bankloan_april bankloan
rename gov_assistance_april gov_assistance
rename forego_expenses_april forego_expenses
rename wap_april wap
rename liheap_april liheap
rename snap_april snap
rename tanf_april tanf
rename ssi_april ssi
rename medicaid_april medicaid
rename vet_benefits_april vet_benefits
rename unemp_insurance_april unemp_insurance
rename stove_4mos stove
rename spaceheater_4mos spaceheater
rename woodstove_4mos woodstove
rename fireplace_4mos fireplace
rename hotshower_4mos hotshower
rename burntrash_4mos burntrash
rename heavycoat_4mos heavycoat
rename boughtice_4mos boughtice
rename coldshowers_4mos coldshower
rename dryer_4mos dryer
rename centralac_4mos centralac
rename windowac_4mos windowac
rename fan_4mos fan
rename dehumidifier_4mos dehumidifier
rename lefthouse_4mos lefthouse
rename openedwindows_4mos openedwindows
rename covid_employment4 covid_employment
rename covid_rent4 covid_rent
rename covid_feedfamily4 covid_feedfamily
rename covid_medicalcare4 covid_medicalcare
rename covid_lostinsurance4 covid_lostinsurance
rename date_unemployed4 date_unemployed
rename employed4 employed
rename unemployed4 unemployed
rename employ4 employ
rename efficient_appliances4 efficient_appliances
rename efficient_insulation4 efficient_insulation
rename efficient_ac4 efficient_ac
rename efficient_smartmeter4 efficient_smartmeter
rename efficient_lights4 efficient_lights
rename efficient_hometemp4 efficient_hometemp
rename efficient_devices4 efficient_devices
rename efficient_hungwindow4 efficient_hungwindow
rename utilitypay_check4 utilitypay_check
rename utilitypay_credit4 utilitypay_credit
rename utilitypay_debit4 utilitypay_debite
rename utilitypay_withdrawal4 utilitypay_withdrawal
rename utilitypay_cash4 utilitypay_cash
rename utilitybill_pay4 utilitybill_pay
rename utilityhelp_friend4 utilityhelp_friend
rename utilityhelp_paydayloan4 utilityhelp_paydayloan
rename utilityhelp_credit4 utilityhelp_credit
rename utilityhelp_notice4 utilityhelp_notice
rename utility_debt4 utility_debt
rename debt_over10004 debt_over1000
rename behind_rent4 behind_rent
rename behind_credit4 behind_credit
rename behind_car4 behind_car
rename behind_medical4 behind_medical
rename behind_bankloan4 behind_bankloan
rename behind_personalloan4 behind_personalloan
rename behind_studentloan4 behind_studentloan
rename evictnotice_april evict_notice
rename evicted_april evicted
rename legal_help4 legal_help
rename legal_access4 legal_access
rename legal_source4 legal_source
rename generalhealth_rate4 generalhealth_rate
rename prescription4 prescription
rename fill_prescription4 fill_prescription
rename mentalhealth_days4 mentalhealth_days
rename highbloodpressure4 highbloodpressure
rename heartdisease4 heartdisease
rename diabetes4 diabetes
rename cancer4 cancer
rename obesity4 obesity
rename asthma4 asthma
rename skipped_meals4 skipped_meals
rename skipped_meals_frequency4 skipped_meals_frequency
rename water_bill4 water_bill
rename water_shutoff4 water_shutoff
rename hh1_income4 hh1_income
rename hh2_income4 hh2_income
rename hh3_income4 hh3_income
rename hh4_income4 hh4_income
rename hh5_income4 hh5_income
rename hh6_income4 hh6_income
rename hh7_income4 hh7_income
rename hh8_income4 hh8_income
rename income4 income
rename sought_govagency4 sought_govagency
rename sought_bank4 sought_bank
rename sought_payday4 sought_payday
rename sought_utility4 sought_utility
rename sought_nonprofit4 sought_nonprofit
rename sought_faithbased4 sought_faithbased
rename sought_family_friends4 sought_family_friends
rename form_call4 form_call
rename form_letter4 form_letter 
rename form_doorknock4 form_doorknock 
rename form_email4 form_email 
rename form_text4 form_text
rename response_contactutility4 response_contactutility
rename response_paymentplan4 response_paymentplan
rename response_legalservices4 response_legalservices
rename response_assistance4 response_assistance
rename response_internet4 response_internet
rename response_homechanges4 response_homechanges
rename response_reduceenergy4 response_reduceenergy
rename response_moved4 response_moved
rename reconnection_cost4 reconnection_cost
rename response_moved_temp4 response_moved_temp
rename response_moved_perm4 response_moved_perm
rename response_livedwithout4 response_livedwithout
rename response_otherhelp4 response_otherhelp
rename response_paidoff4 response_paidoff
rename response_usedothers4 response_usedothers
rename response_carorbattery4 response_carorbattery
rename no_ac4 no_ac
rename no_ac_reason4 no_ac_reason


save april_energy_insecurity.dta, replace

clear




******may2 Data******
use COMBINED_waves_1234.dta, replace
keep weight4 caseid_National caseid_Indiana caseid_w1 inputzip4 marstat state utility_type muni iou coop electricity4 gas4 wood4 propane4 fueloil4 age hhsize4 hh_under54 any_under54 any_over654 hh_over654 covid_lostwork4 covid_insurance4 covid_lessinsurance4 no_insurance4 any_disability4 home_trailer4 home_apartmentcondo4 home_singlefam4 home_other4 utilitybill_pay_irregular4 utilitydebt_over1004 genhealth_goodtogreat4 hh_disability4 educ4 educ_HS4 homeowner4 ownhome4 retired race white black hispanic native_american female hhinc4 fpl4 under_100_fpl4 FPL_100_1504 FPL_150_2004 dwelling_type1 dwelling_type2 dwelling_type3 dwelling_type4 poor_insulation1 drafty1 mold1 holes1 plumbing1 exposed_sockets1 nonworking_stove_fridge1 broken_ac1 poor_insulation2 drafty2 mold2 holes2 plumbing2 exposed_sockets2 nonworking_stove_fridge2 broken_ac2 poor_insulation3 drafty3 mold3 holes3 plumbing3 exposed_sockets3 nonworking_stove_fridge3 broken_ac3 poor_insulation4 drafty4 mold4 holes4 plumbing4 exposed_sockets4 nonworking_stove_fridge4 broken_ac4 trust_energyco4 dwelling_condition1 dwelling_condition2 dwelling_condition3 dwelling_condition4 fuel_payment4 hhbill_may2 notice_may2 disconnect_may2 electronic_device4 energybill_change4 stimulus_may2 energy_assistance_may2 gov_agency_may2 energy_provider_may2 friend_family_may2 faith_org_may2 nonprofit_may2 payday_lender_may2 bankloan_may2 gov_assistance_may2 forego_expenses_may2 wap_may2 liheap_may2 snap_may2 tanf_may2 ssi_may2 medicaid_may2 vet_benefits_may2 unemp_insurance_may2 gov_assistance_may2 stove_4mos spaceheater_4mos woodstove_4mos fireplace_4mos hotshower_4mos burntrash_4mos heavycoat_4mos boughtice_4mos coldshowers_4mos dryer_4mos centralac_4mos windowac_4mos fan_4mos dehumidifier_4mos lefthouse_4mos openedwindows_4mos covid_employment4 covid_rent4 covid_feedfamily4 covid_medicalcare4 covid_lostinsurance4 date_unemployed4 employed4 unemployed4 employ4 efficient_appliances4 efficient_insulation4 efficient_ac4 efficient_smartmeter4 efficient_lights4 efficient_hometemp4 efficient_devices4 efficient_hungwindow4 utilitypay_check4 utilitypay_credit4 utilitypay_debit4 utilitypay_withdrawal4 utilitypay_cash4 utilitybill_pay4 utilityhelp_friend4 utilityhelp_paydayloan4 utilityhelp_credit4 utilityhelp_notice4 utility_debt4 debt_over10004 behind_rent4 behind_credit4 behind_car4 behind_medical4 behind_bankloan4 behind_personalloan4 behind_studentloan4 evictnotice_may2 evicted_may2 legal_help4 legal_access4 legal_source4 generalhealth_rate4 prescription4 fill_prescription4 mentalhealth_days4 highbloodpressure4 heartdisease4 diabetes4 cancer4 obesity4 asthma4 skipped_meals4 skipped_meals_frequency4 water_bill4 water_shutoff4 hh1_income4 hh2_income4 hh3_income4 hh4_income4 hh5_income4 hh6_income4 hh7_income4 hh8_income4 income4 dwelling_open4 employmentstatus_open4 maintainbills_open4 debt_over1000_open4 chronic_conditions_open4 covid_employmentchange_open4 utilitybillpay_open4 utilitybillhelp_open4 utilitypaymethod_open4 staycool_open4 staywarm_open4 govassist_open4 energyassist_open4 response_notice_open4 energyefficiency_open4 sought_govagency4 sought_bank4 sought_payday4 sought_utility4 sought_nonprofit4 sought_faithbased4 sought_family_friends4 form_call4 form_letter4 form_doorknock4 form_email4 form_text4 response_contactutility4 response_paymentplan4 response_legalservices4 response_assistance4 response_internet4 response_homechanges4 response_reduceenergy4 response_moved4 reconnection_cost4 response_moved_temp4 response_moved_perm4 response_livedwithout4 response_otherhelp4 response_paidoff4 response_usedothers4 response_carorbattery4 no_ac4 no_ac_reason4

drop if hhbill_may2==.

gen month=13
gen wave=4

rename weight4 weight
clonevar weight_balanced = weight
rename inputzip4 zip
rename electricity4 electricity
rename gas4 gas
rename wood4 wood
rename propane4 propane
rename fueloil4 fueloil
rename hhsize4 hhsize
rename hh_under54 hh_under5
rename hh_over654 hh_over65
rename any_under54 any_under5
rename any_over654 any_over65
rename covid_lostwork4 covid_lostwork
rename covid_insurance4 covid_insurance
rename covid_lessinsurance4 covid_lessinsurance
rename no_insurance4 no_insurance
rename any_disability4 any_disability
rename home_trailer4 home_trailer
rename home_apartmentcondo4 home_apartmentcondo
rename home_singlefam4 home_singlefam
rename home_other4 home_other
rename utilitybill_pay_irregular4 utilitybill_pay_irregular
rename utilitydebt_over1004 utility_debt_over100
rename genhealth_goodtogreat4 genhealth_goodtogreat
rename hh_disability4 hh_disability
rename educ4 educ
rename educ_HS4 educ_HS
rename homeowner4 homeowner
rename ownhome4 ownhome
rename hhinc4 hhinc
rename fpl4 fpl
rename under_100_fpl4 under_100_fpl
rename FPL_100_1504 FPL_100_150
rename FPL_150_2004 FPL_150_200
rename dwelling_type1 dwelling_type
gen poor_insulation=0
replace poor_insulation=1 if poor_insulation1==1 | poor_insulation2==1 | poor_insulation3==1 | poor_insulation4==1
gen drafty=0
replace drafty=1 if drafty1==1 | drafty2==1 | drafty3==1 | drafty4==1
gen mold=0
replace mold=1 if mold1==1 | mold2==1 | mold3==1 | mold4==1
gen holes=0
replace holes=1 if holes1==1 | holes2==1 | holes3==1 | holes4==1
gen plumbing=0
replace plumbing=1 if plumbing1==1 | plumbing2==1 | plumbing3==1 | plumbing4 ==1
gen exposed_sockets=0
replace exposed_sockets=1 if exposed_sockets1==1 | exposed_sockets2==1 | exposed_sockets3==1 |exposed_sockets4 ==1
gen nonworking_stove_fridge=0
replace nonworking_stove_fridge=1 if nonworking_stove_fridge1==1 | nonworking_stove_fridge2==1 | nonworking_stove_fridge3==1 | nonworking_stove_fridge4==1
gen broken_ac=0
replace broken_ac=1 if broken_ac1==1 | broken_ac2==1 | broken_ac3==1 | broken_ac4==1
rename trust_energyco4 trust_energyco
gen dwelling_condition=0
replace dwelling_condition=1 if dwelling_condition1==1 | dwelling_condition2==1 | dwelling_condition3==1 | dwelling_condition4
rename fuel_payment4 fuel_payment
rename hhbill_may2 hhbill
rename notice_may2 notice
rename disconnect_may2 disconnect
rename electronic_device4 electronic_device
rename energybill_change4 energybill_change
rename stimulus_may2 stimulus
rename energy_assistance_may2 energy_assistance
rename gov_agency_may2 gov_agency
rename energy_provider_may2 energy_provider
rename friend_family_may2 friend_family
rename faith_org_may2 faith_org
rename nonprofit_may2 nonprofit
rename payday_lender_may2 payday_lender
rename bankloan_may2 bankloan
rename gov_assistance_may2 gov_assistance
rename forego_expenses_may2 forego_expenses
rename wap_may2 wap
rename liheap_may2 liheap
rename snap_may2 snap
rename tanf_may2 tanf
rename ssi_may2 ssi
rename medicaid_may2 medicaid
rename vet_benefits_may2 vet_benefits
rename unemp_insurance_may2 unemp_insurance
rename stove_4mos stove
rename spaceheater_4mos spaceheater
rename woodstove_4mos woodstove
rename fireplace_4mos fireplace
rename hotshower_4mos hotshower
rename burntrash_4mos burntrash
rename heavycoat_4mos heavycoat
rename boughtice_4mos boughtice
rename coldshowers_4mos coldshower
rename dryer_4mos dryer
rename centralac_4mos centralac
rename windowac_4mos windowac
rename fan_4mos fan
rename dehumidifier_4mos dehumidifier
rename lefthouse_4mos lefthouse
rename openedwindows_4mos openedwindows
rename covid_employment4 covid_employment
rename covid_rent4 covid_rent
rename covid_feedfamily4 covid_feedfamily
rename covid_medicalcare4 covid_medicalcare
rename covid_lostinsurance4 covid_lostinsurance
rename date_unemployed4 date_unemployed
rename employed4 employed
rename unemployed4 unemployed
rename employ4 employ
rename efficient_appliances4 efficient_appliances
rename efficient_insulation4 efficient_insulation
rename efficient_ac4 efficient_ac
rename efficient_smartmeter4 efficient_smartmeter
rename efficient_lights4 efficient_lights
rename efficient_hometemp4 efficient_hometemp
rename efficient_devices4 efficient_devices
rename efficient_hungwindow4 efficient_hungwindow
rename utilitypay_check4 utilitypay_check
rename utilitypay_credit4 utilitypay_credit
rename utilitypay_debit4 utilitypay_debite
rename utilitypay_withdrawal4 utilitypay_withdrawal
rename utilitypay_cash4 utilitypay_cash
rename utilitybill_pay4 utilitybill_pay
rename utilityhelp_friend4 utilityhelp_friend
rename utilityhelp_paydayloan4 utilityhelp_paydayloan
rename utilityhelp_credit4 utilityhelp_credit
rename utilityhelp_notice4 utilityhelp_notice
rename utility_debt4 utility_debt
rename debt_over10004 debt_over1000
rename behind_rent4 behind_rent
rename behind_credit4 behind_credit
rename behind_car4 behind_car
rename behind_medical4 behind_medical
rename behind_bankloan4 behind_bankloan
rename behind_personalloan4 behind_personalloan
rename behind_studentloan4 behind_studentloan
rename evictnotice_may2 evict_notice
rename evicted_may2 evicted
rename legal_help4 legal_help
rename legal_access4 legal_access
rename legal_source4 legal_source
rename generalhealth_rate4 generalhealth_rate
rename prescription4 prescription
rename fill_prescription4 fill_prescription
rename mentalhealth_days4 mentalhealth_days
rename highbloodpressure4 highbloodpressure
rename heartdisease4 heartdisease
rename diabetes4 diabetes
rename cancer4 cancer
rename obesity4 obesity
rename asthma4 asthma
rename skipped_meals4 skipped_meals
rename skipped_meals_frequency4 skipped_meals_frequency
rename water_bill4 water_bill
rename water_shutoff4 water_shutoff
rename hh1_income4 hh1_income
rename hh2_income4 hh2_income
rename hh3_income4 hh3_income
rename hh4_income4 hh4_income
rename hh5_income4 hh5_income
rename hh6_income4 hh6_income
rename hh7_income4 hh7_income
rename hh8_income4 hh8_income
rename income4 income
rename sought_govagency4 sought_govagency
rename sought_bank4 sought_bank
rename sought_payday4 sought_payday
rename sought_utility4 sought_utility
rename sought_nonprofit4 sought_nonprofit
rename sought_faithbased4 sought_faithbased
rename sought_family_friends4 sought_family_friends
rename form_call4 form_call
rename form_letter4 form_letter 
rename form_doorknock4 form_doorknock 
rename form_email4 form_email 
rename form_text4 form_text
rename response_contactutility4 response_contactutility
rename response_paymentplan4 response_paymentplan
rename response_legalservices4 response_legalservices
rename response_assistance4 response_assistance
rename response_internet4 response_internet
rename response_homechanges4 response_homechanges
rename response_reduceenergy4 response_reduceenergy
rename response_moved4 response_moved
rename reconnection_cost4 reconnection_cost
rename response_moved_temp4 response_moved_temp
rename response_moved_perm4 response_moved_perm
rename response_livedwithout4 response_livedwithout
rename response_otherhelp4 response_otherhelp
rename response_paidoff4 response_paidoff
rename response_usedothers4 response_usedothers
rename response_carorbattery4 response_carorbattery
rename no_ac4 no_ac
rename no_ac_reason4 no_ac_reason

save may2_energy_insecurity.dta, replace


***Append datasets***
clear all

use may_energy_insecurity.dta, clear
append using june_energy_insecurity.dta
append using july_energy_insecurity.dta
append using august_energy_insecurity.dta
append using september_energy_insecurity.dta
append using october_energy_insecurity.dta
append using november_energy_insecurity.dta
append using december_energy_insecurity.dta
append using january_energy_insecurity.dta
append using february_energy_insecurity.dta
append using march_energy_insecurity.dta
append using april_energy_insecurity.dta
append using may2_energy_insecurity.dta

recode zip *=. if zip==544
order wave, after(caseid_w1)

**generate variables for energy insecurity in the previous 12 months (May 2019-May 2020)
rename hhbill_year hhbill_previousyear
rename notice_year notice_previousyear
label define notice_yrlabel 1 "1" 2 "2" 3 "3" 4 "4" 5 "5" 6 "6" 7 "7" 8 "8" 9 "9" 10 "10" 11 "11"
label values notice_previousyear notice_yrlabel
rename disconnect_year disconnect_previousyear
label define disconnect_yrlabel 1 "1" 2 "2" 3 "3" 4 "4" 5 "5" 6 "6" 7 "7" 8 "8" 9 "9" 10 "10" 11 "11"
label values disconnect_previousyear disconnect_yrlabel
rename hhbill_3months1 hhbill_previous3months
rename notice_3months1 notice_previous3months
label define notice_3mlabel 1 "1" 2 "2" 3 "3"
label values notice_previous3months notice_3mlabel
rename disconnect_3months1 disconnect_previous3months
label define disconnect_3mlabel 1 "1" 2 "2" 3 "3"
label values disconnect_previous3months disconnect_3mlabel

save monthly_energy_insecurity.dta, replace
use monthly_energy_insecurity.dta, clear

**incroporating dwelling type responses for respondents who moved
replace dwelling_type=. if dwelling_type2 !=.
replace dwelling_type=. if dwelling_type3 !=.
replace dwelling_type=. if dwelling_type4 !=.

gen dwelling_typeX=. if dwelling_type==.
replace dwelling_typeX=1 if dwelling_type==1 | dwelling_type2==1 | dwelling_type3 ==1 | dwelling_type4==1
replace dwelling_typeX=2 if dwelling_type==2 | dwelling_type2==2 | dwelling_type3 ==2 | dwelling_type4==2
replace dwelling_typeX=3 if dwelling_type==3 | dwelling_type2==3 | dwelling_type3 ==3 | dwelling_type4==3
replace dwelling_typeX=4 if dwelling_type==4 | dwelling_type2==4 | dwelling_type3 ==4 | dwelling_type4==4
replace dwelling_typeX=5 if dwelling_type==5 | dwelling_type2==5 | dwelling_type3 ==5 | dwelling_type4==5
label define dwellingX_label 1 "Trailer or mobile home" 2 "Apartment/duplex/condominum" 3 "Detached, single family home" 4 "Attached single family home" 5 "Other"
label values dwelling_typeX dwellingX_label
drop dwelling_type dwelling_type2 dwelling_type3 dwelling_type4
rename dwelling_typeX dwelling_type

save monthly_energy_insecurity.dta, replace